summaryrefslogtreecommitdiff
path: root/src/format/format-int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/format-int.h')
-rw-r--r--src/format/format-int.h75
1 files changed, 38 insertions, 37 deletions
diff --git a/src/format/format-int.h b/src/format/format-int.h
index de29751..11505d0 100644
--- a/src/format/format-int.h
+++ b/src/format/format-int.h
@@ -45,18 +45,22 @@ typedef SourceEndian (* format_get_endian_fc) (const GBinFormat *);
/* Rythme des allocations pour les entrées de code */
#define EXTRA_POINT_BLOCK 20
-/* Informations glissées dans la structure GObject de GBinFormat */
-typedef union _fmt_obj_extra
+
+/* Informations glissées dans la structure GObject de GArchOperand */
+typedef struct _fmt_extra_data_t
{
- struct
- {
- FormatFlag flags; /* Informations complémentaires*/
+ FormatFlag flags; /* Informations complémentaires*/
+
+} fmt_extra_data_t;
- };
+/* Encapsulation avec un verrou d'accès */
+typedef union _fmt_obj_extra_t
+{
+ fmt_extra_data_t data; /* Données embarquées */
+ lockable_obj_extra_t lockable; /* Gestion d'accès aux fanions */
- gint lock; /* Gestion d'accès aux fanions */
+} fmt_obj_extra_t;
-} fmt_obj_extra;
/* Description d'une erreur */
typedef struct _fmt_error
@@ -73,6 +77,19 @@ struct _GBinFormat
{
GKnownFormat parent; /* A laisser en premier */
+#if __SIZEOF_INT__ == __SIZEOF_LONG__
+
+ /**
+ * L'inclusion des informations suivantes dépend de l'architecture.
+ *
+ * Si la structure GObject possède un trou, on remplit de préférence
+ * ce dernier.
+ */
+
+ fmt_obj_extra_t extra; /* Externalisation embarquée */
+
+#endif
+
virt_t *start_points[DPL_COUNT]; /* Départ de désassemblage */
size_t pt_allocated[DPL_COUNT]; /* Taille d'inscription allouée*/
size_t pt_count[DPL_COUNT]; /* Nombre de points enregistrés*/
@@ -97,53 +114,37 @@ struct _GBinFormat
gint error_locked; /* Statut d'accès à la liste */
#endif
-#if __SIZEOF_INT__ == __SIZEOF_LONG__
+};
- /**
- * L'inclusion des informations suivantes dépend de l'architecture.
- *
- * Si la structure GObject possède un trou, on remplit de préférence
- * ce dernier.
- */
+/* Format binaire générique (classe) */
+struct _GBinFormatClass
+{
+ GKnownFormatClass parent; /* A laisser en premier */
- fmt_obj_extra extra; /* Externalisation embarquée */
+ format_get_endian_fc get_endian; /* Boutisme employé */
-#endif
+ /* Signaux */
+
+ void (* symbol_added) (GBinFormat *, GBinSymbol *);
+ void (* symbol_removed) (GBinFormat *, GBinSymbol *);
};
+
/**
* Accès aux informations éventuellement déportées.
*/
#if __SIZEOF_INT__ == __SIZEOF_LONG__
-# define INIT_BIN_FORMAT_EXTRA(fmt) fmt->extra.lock = 0
-
-# define GET_BIN_FORMAT_EXTRA(fmt) &fmt->extra
+# define GET_BIN_FORMAT_EXTRA(fmt) (fmt_extra_data_t *)&fmt->extra
#else
-# define INIT_BIN_FORMAT_EXTRA(fmt) INIT_GOBJECT_EXTRA(G_OBJECT(fmt))
-
-# define GET_BIN_FORMAT_EXTRA(fmt) GET_GOBJECT_EXTRA(G_OBJECT(fmt), fmt_obj_extra)
+# define GET_BIN_FORMAT_EXTRA(fmt) GET_GOBJECT_EXTRA(G_OBJECT(fmt), fmt_extra_data_t)
#endif
-/* Format binaire générique (classe) */
-struct _GBinFormatClass
-{
- GKnownFormatClass parent; /* A laisser en premier */
-
- format_get_endian_fc get_endian; /* Boutisme employé */
-
- /* Signaux */
-
- void (* symbol_added) (GBinFormat *, GBinSymbol *);
- void (* symbol_removed) (GBinFormat *, GBinSymbol *);
-
-};
-
/* ------------------------------ DECODAGE DE SYMBOLES ------------------------------ */