summaryrefslogtreecommitdiff
path: root/src/arch/operand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/operand.c')
-rw-r--r--src/arch/operand.c248
1 files changed, 1 insertions, 247 deletions
diff --git a/src/arch/operand.c b/src/arch/operand.c
index 8bc85fb..e8a4e58 100644
--- a/src/arch/operand.c
+++ b/src/arch/operand.c
@@ -40,44 +40,16 @@ static void g_arch_operand_class_init(GArchOperandClass *);
/* Initialise une instance d'opérande d'architecture. */
static void g_arch_operand_init(GArchOperand *);
-/* Procède à l'initialisation de l'interface de partage. */
-static void g_arch_operand_interface_init(GSharedInstanceInterface *);
-
/* Supprime toutes les références externes. */
static void g_arch_operand_dispose(GArchOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_arch_operand_finalize(GArchOperand *);
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_arch_operand_share_manager(const GArchOperand *);
-
-/* Initialise un nouvel objet partagé avec des informations. */
-static bool g_arch_operand_apply_template(GArchOperand *, const GArchOperand *);
-
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_arch_operand_define_template(const GArchOperand *, GArchOperand *);
-
-/* Libère la mémoire utilisée par un patron d'instance. */
-static void g_arch_operand_free_template(const GArchOperand *, GArchOperand *);
-
-/* Fournit la valeur du compteur de partage. */
-static unsigned int g_arch_operand_get_references(const GArchOperand *);
-
-/* Incrémente le compteur de partage. */
-static void g_arch_operand_inc_references(GArchOperand *);
-
-/* Décrémente le compteur de partage. */
-static void g_arch_operand_dec_references(GArchOperand *);
-
-/* Compare le contenu d'un opérande avec un autre. */
-static int g_arch_operand_compare_shared(const GArchOperand * const *, const GArchOperand * const *);
-
/* Indique le type défini pour un opérande d'architecture. */
-G_DEFINE_TYPE_WITH_CODE(GArchOperand, g_arch_operand, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE(G_TYPE_SHARED_INSTANCE, g_arch_operand_interface_init));
+G_DEFINE_TYPE(GArchOperand, g_arch_operand, G_TYPE_OBJECT);
@@ -125,35 +97,6 @@ static void g_arch_operand_init(GArchOperand *operand)
/******************************************************************************
* *
-* Paramètres : iface = interface GLib à initialiser. *
-* *
-* Description : Procède à l'initialisation de l'interface de partage. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_arch_operand_interface_init(GSharedInstanceInterface *iface)
-{
- iface->get_manager = (get_share_manager_fc)get_arch_operand_share_manager;
-
- iface->apply_template = (apply_shared_template_fc)g_arch_operand_apply_template;
- iface->define_template = (define_shared_template_fc)g_arch_operand_define_template;
- iface->free_template = (free_shared_template_fc)g_arch_operand_free_template;
-
- iface->get_ref = (get_shared_ref_fc)g_arch_operand_get_references;
- iface->inc_ref = (inc_shared_ref_fc)g_arch_operand_inc_references;
- iface->dec_ref = (dec_shared_ref_fc)g_arch_operand_dec_references;
-
- iface->compare = (compare_shared_fc)g_arch_operand_compare_shared;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : operand = instance d'objet GLib à traiter. *
* *
* Description : Supprime toutes les références externes. *
@@ -194,195 +137,6 @@ static void g_arch_operand_finalize(GArchOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = instance partagée à consulter. *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_arch_operand_share_manager(const GArchOperand *operand)
-{
- GShareManager *result; /* Instance à retourner */
-
- if (G_ARCH_OPERAND_GET_CLASS(operand)->get_manager == NULL)
- printf("No manager for '%s'\n", G_OBJECT_TYPE_NAME(operand));
-
- result = G_ARCH_OPERAND_GET_CLASS(operand)->get_manager();
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à initialiser. *
-* template = information à utiliser pour la mise en place. *
-* *
-* Description : Initialise un nouvel objet partagé avec des informations. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_arch_operand_apply_template(GArchOperand *operand, const GArchOperand *template)
-{
- bool result; /* Bilan à retourner */
- apply_operand_template_fc func; /* Fonction à appeler */
-
- func = G_ARCH_OPERAND_GET_CLASS(operand)->apply_template;
-
- if (func != NULL)
- result = func(operand, template);
-
- else
- {
- if (G_ARCH_OPERAND_GET_CLASS(operand)->define_template == NULL)
- printf("No def for '%s'\n", G_OBJECT_TYPE_NAME(operand));
-
-
- G_ARCH_OPERAND_GET_CLASS(operand)->define_template(template, operand);
- result = true;
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_arch_operand_define_template(const GArchOperand *operand, GArchOperand *template)
-{
- G_ARCH_OPERAND_GET_CLASS(operand)->define_template(operand, template);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations dont le contenu est à libérer. *
-* *
-* Description : Libère la mémoire utilisée par un patron d'instance. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_arch_operand_free_template(const GArchOperand *operand, GArchOperand *template)
-{
- free_operand_template_fc func; /* Fonction à appeler */
-
- func = G_ARCH_OPERAND_GET_CLASS(operand)->free_template;
-
- if (func != NULL)
- func(operand, template);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* *
-* Description : Fournit la valeur du compteur de partage. *
-* *
-* Retour : Nombre de partages courant. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static unsigned int g_arch_operand_get_references(const GArchOperand *operand)
-{
- return operand->shared_count;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à modifier. *
-* *
-* Description : Incrémente le compteur de partage. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_arch_operand_inc_references(GArchOperand *operand)
-{
- operand->shared_count++;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à modifier. *
-* *
-* Description : Décrémente le compteur de partage. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_arch_operand_dec_references(GArchOperand *operand)
-{
- operand->shared_count--;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : a = premier opérande à consulter. *
-* b = second opérande à consulter. *
-* *
-* Description : Compare le contenu d'un opérande avec un autre. *
-* *
-* Retour : Bilan de la comparaison. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static int g_arch_operand_compare_shared(const GArchOperand * const *a, const GArchOperand * const *b)
-{
- int result; /* Bilan à faire remonter */
-
- result = G_ARCH_OPERAND_GET_CLASS(*a)->compare(*a, *b);
-
- return result;
-
-}
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *