summaryrefslogtreecommitdiff
path: root/src/arch/operand-int.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2025-03-17 07:36:58 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2025-03-17 07:36:58 (GMT)
commita28e1b94a83bee9a2424ab84818a5547eafaf0cf (patch)
treeecaf5556433afd4f19f4bfcbf378cdde3f619e51 /src/arch/operand-int.h
parentb18c64b69c8c048c640b5d9f6c45b1cfda605ae8 (diff)
Restore the definition of main operands.gtk4
Diffstat (limited to 'src/arch/operand-int.h')
-rw-r--r--src/arch/operand-int.h92
1 files changed, 57 insertions, 35 deletions
diff --git a/src/arch/operand-int.h b/src/arch/operand-int.h
index e6c1232..a83d135 100644
--- a/src/arch/operand-int.h
+++ b/src/arch/operand-int.h
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* operand-int.h - prototypes pour la définition générique interne des opérandes
*
- * Copyright (C) 2008-2020 Cyrille Bagard
+ * Copyright (C) 2008-2024 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -28,11 +28,23 @@
#include "operand.h"
+#include "../common/szbin.h"
+#include "../glibext/objhole-int.h"
+
+
+
+/* Exporte une chaîne de caractères à partir d'un objet. */
+//typedef bool (* arch_operand_to_string_fc) (const GArchOperand *operand, unsigned int flags, sized_binary_t *);
+
+
+
+#if 0
+
+
#include <stdbool.h>
#include "../analysis/storage/storage.h"
-#include "../glibext/objhole.h"
@@ -71,46 +83,38 @@ typedef bool (* load_operand_fc) (GArchOperand *, GObjectStorage *, packed_buffe
typedef bool (* store_operand_fc) (GArchOperand *, GObjectStorage *, packed_buffer_t *);
-/* Informations glissées dans la structure GObject de GArchOperand */
-typedef struct _operand_extra_data_t
-{
- ArchOperandFlag flags; /* Informations diverses */
-} operand_extra_data_t;
-/* Encapsulation avec un verrou d'accès */
-typedef union _operand_obj_extra_t
-{
- operand_extra_data_t data; /* Données embarquées */
- lockable_obj_extra_t lockable; /* Gestion d'accès aux fanions */
+#endif
-} operand_obj_extra_t;
+
+#define ARCH_OPERAND_EXTRA_DATA(mx) \
+ \
+ unsigned int reserved : GOBJECT_RESERVED_EXTRA_BITS; \
+ \
+ /** \
+ * ArchOperandFlag \
+ */ \
+ unsigned int flags : mx;
/* Définition générique d'un opérande d'architecture (instance) */
struct _GArchOperand
{
- GObject parent; /* A laisser en premier */
-
-#if 1 //__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.
- */
-
- operand_obj_extra_t extra; /* Externalisation embarquée */
-
-#endif
+ GThickObject parent; /* A laisser en premier */
};
/* Définition générique d'un opérande d'architecture (classe) */
struct _GArchOperandClass
{
- GObjectClass parent; /* A laisser en premier */
+ GThickObjectClass parent; /* A laisser en premier */
+
+
+
+
+
+#if 0
operand_compare_fc compare; /* Comparaison d'opérandes */
find_inner_operand_fc find_inner; /* Définition d'un chemin */
@@ -128,6 +132,8 @@ struct _GArchOperandClass
load_operand_fc load; /* Chargement depuis un tampon */
store_operand_fc store; /* Conservation dans un tampon */
+#endif
+
};
@@ -135,22 +141,36 @@ struct _GArchOperandClass
* Accès aux informations éventuellement déportées.
*/
-#if 1 //__SIZEOF_INT__ == __SIZEOF_LONG__
+/* Informations glissées dans la structure GObject de GArchOperand */
+typedef struct _operand_extra_data_t
+{
+ ARCH_OPERAND_EXTRA_DATA(3); /* Informations pour l'opérande*/
-# define GET_ARCH_OP_EXTRA(op) (operand_extra_data_t *)&op->extra
+} operand_extra_data_t;
-#else
-# define GET_ARCH_OP_EXTRA(op) GET_GOBJECT_EXTRA(G_OBJECT(op), operand_extra_data_t)
+#define GET_ARCH_OP_EXTRA(op) \
+ GET_GOBJECT_EXTRA(op, operand_extra_data_t)
+
+#define SET_ARCH_OP_EXTRA(op, data) \
+ SET_GOBJECT_EXTRA(op, operand_extra_data_t, data)
+
+
+
+
+
+
+
+
+#if 0
-#endif
/* Ajoute une information complémentaire à un opérande. */
-bool _g_arch_operand_set_flag(GArchOperand *, ArchOperandFlag, bool);
+//bool _g_arch_operand_set_flag(GArchOperand *, ArchOperandFlag, bool);
/* Retire une information complémentaire à un opérande. */
-bool _g_arch_operand_unset_flag(GArchOperand *, ArchOperandFlag, bool);
+//bool _g_arch_operand_unset_flag(GArchOperand *, ArchOperandFlag, bool);
@@ -190,5 +210,7 @@ bool g_arch_operand_store_generic_fixed(GArchOperand *, GObjectStorage *, packed
bool g_arch_operand_store_generic_variadic(GArchOperand *, GObjectStorage *, packed_buffer_t *);
+#endif
+
#endif /* _ARCH_OPERAND_INT_H */