diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-09-26 22:40:22 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-09-26 22:40:22 (GMT) |
commit | d8f695596e4225de797504f8f797e1347491dd14 (patch) | |
tree | 6daaae9757c6207f9cf94c9fc39bf4f597af243d /src/analysis/contents/encapsulated.c | |
parent | 3e97a551f9a7178717b8ad2810b312d8fbacd689 (diff) |
Extended the API for binary contents.
Diffstat (limited to 'src/analysis/contents/encapsulated.c')
-rw-r--r-- | src/analysis/contents/encapsulated.c | 48 |
1 files changed, 48 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. * * * |