summaryrefslogtreecommitdiff
path: root/plugins/dalvik/operands/args.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dalvik/operands/args.c')
-rw-r--r--plugins/dalvik/operands/args.c112
1 files changed, 112 insertions, 0 deletions
diff --git a/plugins/dalvik/operands/args.c b/plugins/dalvik/operands/args.c
index 6387092..2c7bc57 100644
--- a/plugins/dalvik/operands/args.c
+++ b/plugins/dalvik/operands/args.c
@@ -82,6 +82,20 @@ static void g_dalvik_args_operand_print(const GDalvikArgsOperand *, GBufferLine
+/* ------------------------ CONTROLE DU VOLUME DES INSTANCES ------------------------ */
+
+
+/* Fournit une liste de candidats embarqués par un candidat. */
+static GArchOperand **g_dalvik_args_operand_list_inner_instances(const GDalvikArgsOperand *, size_t *);
+
+/* Met à jour une liste de candidats embarqués par un candidat. */
+static void g_dalvik_args_operand_update_inner_instances(GDalvikArgsOperand *, GArchOperand **, size_t);
+
+/* Fournit l'empreinte d'un candidat à une centralisation. */
+static guint g_dalvik_args_operand_hash(const GDalvikArgsOperand *);
+
+
+
/* --------------------- TRANSPOSITIONS VIA CACHE DES OPERANDES --------------------- */
@@ -127,6 +141,10 @@ static void g_dalvik_args_operand_class_init(GDalvikArgsOperandClass *klass)
operand->print = (operand_print_fc)g_dalvik_args_operand_print;
+ operand->list_inner = (operand_list_inners_fc)g_dalvik_args_operand_list_inner_instances;
+ operand->update_inner = (operand_update_inners_fc)g_dalvik_args_operand_update_inner_instances;
+ operand->hash = (operand_hash_fc)g_dalvik_args_operand_hash;
+
operand->unserialize = (unserialize_operand_fc)g_dalvik_args_operand_unserialize;
operand->serialize = (serialize_operand_fc)g_dalvik_args_operand_serialize;
@@ -485,6 +503,100 @@ GArchOperand *g_dalvik_args_operand_get(const GDalvikArgsOperand *operand, size_
/* ---------------------------------------------------------------------------------- */
+/* CONTROLE DU VOLUME DES INSTANCES */
+/* ---------------------------------------------------------------------------------- */
+
+
+/******************************************************************************
+* *
+* Paramètres : operand = objet dont l'instance se veut unique. *
+* count = quantité d'instances à l'unicité internes. *
+* *
+* Description : Fournit une liste de candidats embarqués par un candidat. *
+* *
+* Retour : Liste de candidats internes ou NULL si aucun. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static GArchOperand **g_dalvik_args_operand_list_inner_instances(const GDalvikArgsOperand *operand, size_t *count)
+{
+ GArchOperand **result; /* Instances à retourner */
+ size_t i; /* Boucle de parcours */
+
+ *count = operand->count;
+
+ result = malloc(*count * sizeof(GArchOperand *));
+
+ for (i = 0; i < *count; i++)
+ {
+ result[i] = operand->args[i];
+ g_object_ref(G_OBJECT(result[i]));
+ }
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : operand = objet dont l'instance se veut unique. *
+* instances = liste de candidats internes devenus singletons. *
+* count = quantité d'instances à l'unicité internes. *
+* *
+* Description : Met à jour une liste de candidats embarqués par un candidat. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_dalvik_args_operand_update_inner_instances(GDalvikArgsOperand *operand, GArchOperand **instances, size_t count)
+{
+ size_t i; /* Boucle de parcours */
+
+ assert(count == operand->count);
+
+ for (i = 0; i < count; i++)
+ {
+ g_object_unref(G_OBJECT(operand->args[i]));
+
+ operand->args[i] = instances[i];
+ g_object_ref(G_OBJECT(instances[i]));
+
+ }
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : operand = objet dont l'instance se veut unique. *
+* *
+* Description : Fournit l'empreinte d'un candidat à une centralisation. *
+* *
+* Retour : Empreinte de l'élément représenté. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static guint g_dalvik_args_operand_hash(const GDalvikArgsOperand *operand)
+{
+ guint result; /* Valeur à retourner */
+
+ result = operand->count;
+
+ return result;
+
+}
+
+
+
+/* ---------------------------------------------------------------------------------- */
/* TRANSPOSITIONS VIA CACHE DES OPERANDES */
/* ---------------------------------------------------------------------------------- */