diff options
Diffstat (limited to 'src/analysis/contents')
-rw-r--r-- | src/analysis/contents/encapsulated.c | 48 | ||||
-rw-r--r-- | src/analysis/contents/file.c | 24 | ||||
-rw-r--r-- | src/analysis/contents/memory.c | 24 | ||||
-rw-r--r-- | src/analysis/contents/restricted.c | 24 |
4 files changed, 120 insertions, 0 deletions
diff --git a/src/analysis/contents/encapsulated.c b/src/analysis/contents/encapsulated.c index 74795ea..8a6ecae 100644 --- a/src/analysis/contents/encapsulated.c +++ b/src/analysis/contents/encapsulated.c @@ -85,6 +85,12 @@ static void g_encaps_content_compute_checksum(GEncapsContent *, GChecksum *); /* Détermine le nombre d'octets lisibles. */ static phys_t g_encaps_content_compute_size(const GEncapsContent *); +/* Détermine la position initiale d'un contenu. */ +static void g_encaps_content_compute_start_pos(const GEncapsContent *, vmpa2t *); + +/* Détermine la position finale d'un contenu. */ +static void g_encaps_content_compute_end_pos(const GEncapsContent *, vmpa2t *); + /* Avance la tête de lecture d'une certaine quantité de données. */ static bool g_encaps_content_seek(const GEncapsContent *, vmpa2t *, phys_t); @@ -193,6 +199,8 @@ static void g_encaps_content_interface_init(GBinContentInterface *iface) iface->compute_checksum = (compute_checksum_fc)g_encaps_content_compute_checksum; iface->compute_size = (compute_size_fc)g_encaps_content_compute_size; + iface->compute_start_pos = (compute_start_pos_fc)g_encaps_content_compute_start_pos; + iface->compute_end_pos = (compute_end_pos_fc)g_encaps_content_compute_end_pos; iface->seek = (seek_fc)g_encaps_content_seek; @@ -525,6 +533,46 @@ static phys_t g_encaps_content_compute_size(const GEncapsContent *content) /****************************************************************************** * * * Paramètres : content = contenu binaire à venir lire. * +* pos = position initiale. [OUT] * +* * +* Description : Détermine la position initiale d'un contenu. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_encaps_content_compute_start_pos(const GEncapsContent *content, vmpa2t *pos) +{ + g_binary_content_compute_start_pos(content->endpoint, pos); + +} + + +/****************************************************************************** +* * +* Paramètres : content = contenu binaire à venir lire. * +* pos = position finale (exclusive). [OUT] * +* * +* Description : Détermine la position finale d'un contenu. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_encaps_content_compute_end_pos(const GEncapsContent *content, vmpa2t *pos) +{ + g_binary_content_compute_end_pos(content->endpoint, pos); + +} + + +/****************************************************************************** +* * +* Paramètres : content = contenu binaire à venir lire. * * addr = position de la tête de lecture. * * length = quantité d'octets à provisionner. * * * diff --git a/src/analysis/contents/file.c b/src/analysis/contents/file.c index 3f256c9..6b55840 100644 --- a/src/analysis/contents/file.c +++ b/src/analysis/contents/file.c @@ -88,6 +88,9 @@ static void g_file_content_compute_checksum(GFileContent *, GChecksum *); /* Détermine le nombre d'octets lisibles. */ static phys_t g_file_content_compute_size(const GFileContent *); +/* Détermine la position initiale d'un contenu. */ +static void g_file_content_compute_start_pos(const GFileContent *, vmpa2t *); + /* Détermine la position finale d'un contenu. */ static void g_file_content_compute_end_pos(const GFileContent *, vmpa2t *); @@ -193,6 +196,7 @@ static void g_file_content_interface_init(GBinContentInterface *iface) iface->compute_checksum = (compute_checksum_fc)g_file_content_compute_checksum; iface->compute_size = (compute_size_fc)g_file_content_compute_size; + iface->compute_start_pos = (compute_start_pos_fc)g_file_content_compute_start_pos; iface->compute_end_pos = (compute_end_pos_fc)g_file_content_compute_end_pos; iface->seek = (seek_fc)g_file_content_seek; @@ -530,6 +534,26 @@ static phys_t g_file_content_compute_size(const GFileContent *content) /****************************************************************************** * * * Paramètres : content = contenu binaire à venir lire. * +* pos = position initiale. [OUT] * +* * +* Description : Détermine la position initiale d'un contenu. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_file_content_compute_start_pos(const GFileContent *content, vmpa2t *pos) +{ + copy_vmpa(pos, get_mrange_addr(&content->range)); + +} + + +/****************************************************************************** +* * +* Paramètres : content = contenu binaire à venir lire. * * pos = position finale (exclusive). [OUT] * * * * Description : Détermine la position finale d'un contenu. * diff --git a/src/analysis/contents/memory.c b/src/analysis/contents/memory.c index 404481f..7406a3a 100644 --- a/src/analysis/contents/memory.c +++ b/src/analysis/contents/memory.c @@ -88,6 +88,9 @@ static void g_memory_content_compute_checksum(GMemoryContent *, GChecksum *); /* Détermine le nombre d'octets lisibles. */ static phys_t g_memory_content_compute_size(const GMemoryContent *); +/* Détermine la position initiale d'un contenu. */ +static void g_memory_content_compute_start_pos(const GMemoryContent *, vmpa2t *); + /* Détermine la position finale d'un contenu. */ static void g_memory_content_compute_end_pos(const GMemoryContent *, vmpa2t *); @@ -195,6 +198,7 @@ static void g_memory_content_interface_init(GBinContentInterface *iface) iface->compute_checksum = (compute_checksum_fc)g_memory_content_compute_checksum; iface->compute_size = (compute_size_fc)g_memory_content_compute_size; + iface->compute_start_pos = (compute_start_pos_fc)g_memory_content_compute_start_pos; iface->compute_end_pos = (compute_end_pos_fc)g_memory_content_compute_end_pos; iface->seek = (seek_fc)g_memory_content_seek; @@ -513,6 +517,26 @@ static phys_t g_memory_content_compute_size(const GMemoryContent *content) /****************************************************************************** * * * Paramètres : content = contenu binaire à venir lire. * +* pos = position initiale. [OUT] * +* * +* Description : Détermine la position initiale d'un contenu. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_memory_content_compute_start_pos(const GMemoryContent *content, vmpa2t *pos) +{ + g_binary_content_compute_start_pos(content->backend, pos); + +} + + +/****************************************************************************** +* * +* Paramètres : content = contenu binaire à venir lire. * * pos = position finale (exclusive). [OUT] * * * * Description : Détermine la position finale d'un contenu. * diff --git a/src/analysis/contents/restricted.c b/src/analysis/contents/restricted.c index 647192f..1c0c8e6 100644 --- a/src/analysis/contents/restricted.c +++ b/src/analysis/contents/restricted.c @@ -75,6 +75,9 @@ static void g_restricted_content_compute_checksum(GRestrictedContent *, GChecksu /* Détermine le nombre d'octets lisibles. */ static phys_t g_restricted_content_compute_size(const GRestrictedContent *); +/* Détermine la position initiale d'un contenu. */ +static void g_restricted_content_compute_start_pos(const GRestrictedContent *, vmpa2t *); + /* Détermine la position finale d'un contenu. */ static void g_restricted_content_compute_end_pos(const GRestrictedContent *, vmpa2t *); @@ -176,6 +179,7 @@ static void g_restricted_content_interface_init(GBinContentInterface *iface) iface->compute_checksum = (compute_checksum_fc)g_restricted_content_compute_checksum; iface->compute_size = (compute_size_fc)g_restricted_content_compute_size; + iface->compute_start_pos = (compute_start_pos_fc)g_restricted_content_compute_start_pos; iface->compute_end_pos = (compute_end_pos_fc)g_restricted_content_compute_end_pos; iface->seek = (seek_fc)g_restricted_content_seek; @@ -379,6 +383,26 @@ static phys_t g_restricted_content_compute_size(const GRestrictedContent *conten /****************************************************************************** * * * Paramètres : content = contenu binaire à venir lire. * +* pos = position initiale. [OUT] * +* * +* Description : Détermine la position initiale d'un contenu. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_restricted_content_compute_start_pos(const GRestrictedContent *content, vmpa2t *pos) +{ + copy_vmpa(pos, get_mrange_addr(&content->range)); + +} + + +/****************************************************************************** +* * +* Paramètres : content = contenu binaire à venir lire. * * pos = position finale (exclusive). [OUT] * * * * Description : Détermine la position finale d'un contenu. * |