diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2013-03-19 21:13:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2013-03-19 21:13:51 (GMT) |
commit | cf97db0ea4d1ea983db38df85984034b49fa4f77 (patch) | |
tree | b6d69945b24ec8da93f0bef7ccf4dfdbe1d920a2 /src/arch | |
parent | e7a85861ba8bcd00ceb7bf9e47f4eadccd48ce3f (diff) |
Defined the first steps towards new graph renderings.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@345 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/instruction.c | 36 | ||||
-rw-r--r-- | src/arch/instruction.h | 3 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index c40ff51..3831ee4 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -533,6 +533,42 @@ GArchInstruction *g_arch_instruction_get_given_destination(const GArchInstructio } +/****************************************************************************** +* * +* Paramètres : iter = membre du groupe donné en référence. * +* list = liste des instructions à analyser. * +* count = taille de cette liste. * +* * +* Description : Indique la position dans les instructions identiques. * +* * +* Retour : Indice dans les instructions identiques du groupe. * +* * +* Remarques : - * +* * +******************************************************************************/ + +size_t g_arch_instruction_compute_group_index(GArchInstruction **iter, GArchInstruction **list, size_t count) +{ + size_t result; /* Valeur à retourner */ + size_t i; /* Boucle de parcours */ + + result = 0; + + for (i = 0; i < count; i++) + { + if ((list + i) == iter) + break; + + if (list[i] == *iter) + result++; + + } + + return result; + +} + + /* ---------------------------------------------------------------------------------- */ /* CONVERSIONS DU FORMAT DES INSTRUCTIONS */ diff --git a/src/arch/instruction.h b/src/arch/instruction.h index c4b704e..a6a0422 100644 --- a/src/arch/instruction.h +++ b/src/arch/instruction.h @@ -130,6 +130,9 @@ size_t g_arch_instruction_get_destinations(const GArchInstruction *, GArchInstru /* Fournit la destination d'une instruction et d'un type donné. */ GArchInstruction *g_arch_instruction_get_given_destination(const GArchInstruction *, InstructionLinkType); +/* Indique la position dans les instructions identiques. */ +size_t g_arch_instruction_compute_group_index(GArchInstruction **, GArchInstruction **, size_t); + /* --------------------- CONVERSIONS DU FORMAT DES INSTRUCTIONS --------------------- */ |