summaryrefslogtreecommitdiff
path: root/src/analysis/content-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/content-int.h')
-rw-r--r--src/analysis/content-int.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/analysis/content-int.h b/src/analysis/content-int.h
index 886c196..3475b3f 100644
--- a/src/analysis/content-int.h
+++ b/src/analysis/content-int.h
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* content-int.h - définitions internes propres aux contenus binaires
*
- * Copyright (C) 2015-2019 Cyrille Bagard
+ * Copyright (C) 2015-2023 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -26,6 +26,7 @@
#include "content.h"
+#include "storage/serialize-int.h"
@@ -41,9 +42,6 @@ typedef GBinContent * (* get_content_root_fc) (GBinContent *);
/* Fournit le nom associé au contenu binaire. */
typedef char * (* describe_content_fc) (const GBinContent *, bool);
-/* Ecrit une sauvegarde de contenu binaire dans un fichier XML. */
-typedef bool (* save_content_fc) (const GBinContent *, xmlDocPtr, xmlXPathContextPtr, const char *, const char *);
-
/* Calcule une empreinte unique (SHA256) pour les données. */
typedef void (* compute_checksum_fc) (GBinContent *, GChecksum *);
@@ -86,11 +84,24 @@ typedef bool (* read_uleb128_fc) (const GBinContent *, vmpa2t *, uleb128_t *);
/* Lit un nombre signé encodé au format LEB128. */
typedef bool (* read_leb128_fc) (const GBinContent *, vmpa2t *, leb128_t *);
+/* Charge un objet depuis une mémoire tampon. */
+typedef bool (* load_content_cb) (GBinContent *, GObjectStorage *, packed_buffer_t *);
+
+/* Sauvegarde un objet dans une mémoire tampon. */
+typedef bool (* store_content_cb) (const GBinContent *, GObjectStorage *, packed_buffer_t *);
+
-/* Accès à un contenu binaire quelconque (interface) */
-struct _GBinContentIface
+/* Accès à un contenu binaire quelconque (instance) */
+struct _GBinContent
{
- GTypeInterface base_iface; /* A laisser en premier */
+ GObject parent; /* A laisser en premier */
+
+};
+
+/* Accès à un contenu binaire quelconque (classe) */
+struct _GBinContentClass
+{
+ GObjectClass parent; /* A laisser en premier */
set_content_attributes set_attribs; /* Enregistrement d'attributs */
get_content_attributes get_attribs; /* Fourniture d'attributs */
@@ -99,8 +110,6 @@ struct _GBinContentIface
describe_content_fc describe; /* Fournit une description */
- save_content_fc save; /* Sauvegarde du contenu */
-
compute_checksum_fc compute_checksum; /* Calcul de l'empreinte */
compute_size_fc compute_size; /* Calcul de la taille totale */
@@ -121,11 +130,10 @@ struct _GBinContentIface
read_uleb128_fc read_uleb128; /* Lecture d'un LEB non signé */
read_leb128_fc read_leb128; /* Lecture d'un LEB signé */
-};
+ load_content_cb load; /* Chargement */
+ store_content_cb store; /* Enregistrement */
-
-/* Redéfinition */
-typedef GBinContentIface GBinContentInterface;
+};