diff options
Diffstat (limited to 'src/analysis/contents/restricted.c')
-rw-r--r-- | src/analysis/contents/restricted.c | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/src/analysis/contents/restricted.c b/src/analysis/contents/restricted.c index 9b4e1c8..95f513b 100644 --- a/src/analysis/contents/restricted.c +++ b/src/analysis/contents/restricted.c @@ -55,12 +55,13 @@ static void g_restricted_content_finalize(GRestrictedContent *); /* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */ - +#if 0 // FIXME /* Associe un ensemble d'attributs au contenu binaire. */ static void g_restricted_content_set_attributes(GRestrictedContent *, GContentAttributes *); /* Fournit l'ensemble des attributs associés à un contenu. */ static GContentAttributes *g_restricted_content_get_attributes(const GRestrictedContent *); +#endif /* Donne l'origine d'un contenu binaire. */ static GBinContent *g_restricted_content_get_root(GRestrictedContent *); @@ -69,16 +70,16 @@ static GBinContent *g_restricted_content_get_root(GRestrictedContent *); static char *g_restricted_content_describe(const GRestrictedContent *, bool); /* Calcule une empreinte unique (SHA256) pour les données. */ -static void g_restricted_content_compute_checksum(GRestrictedContent *, GChecksum *); +static void g_restricted_content_compute_checksum(const GRestrictedContent *, GChecksum *); /* 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 *); +static bool 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 *); +static bool g_restricted_content_compute_end_pos(const GRestrictedContent *, vmpa2t *); /* Avance la tête de lecture d'une certaine quantité de données. */ static bool g_restricted_content_seek(const GRestrictedContent *, vmpa2t *, phys_t); @@ -109,13 +110,13 @@ static bool g_restricted_content_read_uleb128(const GRestrictedContent *, vmpa2t /* Lit un nombre signé encodé au format LEB128. */ static bool g_restricted_content_read_leb128(const GRestrictedContent *, vmpa2t *, leb128_t *); - +#if 0 // FIXME /* Charge un contenu depuis une mémoire tampon. */ static bool g_restricted_content_load(GRestrictedContent *, GObjectStorage *, packed_buffer_t *); /* Sauvegarde un contenu dans une mémoire tampon. */ static bool g_restricted_content_store(const GRestrictedContent *, GObjectStorage *, packed_buffer_t *); - +#endif /* ---------------------------------------------------------------------------------- */ @@ -151,8 +152,10 @@ static void g_restricted_content_class_init(GRestrictedContentClass *klass) content = G_BIN_CONTENT_CLASS(klass); +#if 0 // FIXME content->set_attribs = (set_content_attributes)g_restricted_content_set_attributes; content->get_attribs = (get_content_attributes)g_restricted_content_get_attributes; +#endif content->get_root = (get_content_root_fc)g_restricted_content_get_root; @@ -178,8 +181,10 @@ static void g_restricted_content_class_init(GRestrictedContentClass *klass) content->read_uleb128 = (read_uleb128_fc)g_restricted_content_read_uleb128; content->read_leb128 = (read_leb128_fc)g_restricted_content_read_leb128; +#if 0 // FIXME content->load = (load_content_cb)g_restricted_content_load; content->store = (store_content_cb)g_restricted_content_store; +#endif } @@ -344,7 +349,7 @@ void g_restricted_content_get_range(const GRestrictedContent *content, mrange_t * Remarques : - * * * ******************************************************************************/ - +#if 0 // FIXME static void g_restricted_content_set_attributes(GRestrictedContent *content, GContentAttributes *attribs) { g_binary_content_set_attributes(content->internal, attribs); @@ -373,6 +378,7 @@ static GContentAttributes *g_restricted_content_get_attributes(const GRestricted return result; } +#endif /****************************************************************************** @@ -462,7 +468,7 @@ static char *g_restricted_content_describe(const GRestrictedContent *content, bo * * ******************************************************************************/ -static void g_restricted_content_compute_checksum(GRestrictedContent *content, GChecksum *checksum) +static void g_restricted_content_compute_checksum(const GRestrictedContent *content, GChecksum *checksum) { vmpa2t start; /* Point de départ */ phys_t i; /* Boucle de parcours */ @@ -516,16 +522,22 @@ static phys_t g_restricted_content_compute_size(const GRestrictedContent *conten * * * Description : Détermine la position initiale d'un contenu. * * * -* Retour : - * +* Retour : Validité finale de la position fournie. * * * * Remarques : - * * * ******************************************************************************/ -static void g_restricted_content_compute_start_pos(const GRestrictedContent *content, vmpa2t *pos) +static bool g_restricted_content_compute_start_pos(const GRestrictedContent *content, vmpa2t *pos) { + bool result; /* Bilan à retourner */ + + result = true; + copy_vmpa(pos, get_mrange_addr(&content->range)); + return result; + } @@ -536,16 +548,22 @@ static void g_restricted_content_compute_start_pos(const GRestrictedContent *con * * * Description : Détermine la position finale d'un contenu. * * * -* Retour : - * +* Retour : Validité finale de la position fournie. * * * * Remarques : - * * * ******************************************************************************/ -static void g_restricted_content_compute_end_pos(const GRestrictedContent *content, vmpa2t *pos) +static bool g_restricted_content_compute_end_pos(const GRestrictedContent *content, vmpa2t *pos) { + bool result; /* Bilan à retourner */ + + result = true; + compute_mrange_end_addr(&content->range, pos); + return result; + } @@ -977,7 +995,7 @@ static bool g_restricted_content_read_leb128(const GRestrictedContent *content, * Remarques : - * * * ******************************************************************************/ - +#if 0 // FIXME static bool g_restricted_content_load(GRestrictedContent *content, GObjectStorage *storage, packed_buffer_t *pbuf) { bool result; /* Bilan à retourner */ @@ -1019,3 +1037,4 @@ static bool g_restricted_content_store(const GRestrictedContent *content, GObjec return result; } +#endif |