diff options
Diffstat (limited to 'src/decomp/instruction.c')
-rw-r--r-- | src/decomp/instruction.c | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/src/decomp/instruction.c b/src/decomp/instruction.c index c1afa44..c48ac7b 100644 --- a/src/decomp/instruction.c +++ b/src/decomp/instruction.c @@ -72,6 +72,7 @@ static void g_dec_instruction_class_init(GDecInstructionClass *klass) static void g_dec_instruction_init(GDecInstruction *instr) { + DL_LIST_ITEM_INIT(&instr->flow); } @@ -99,3 +100,107 @@ void g_dec_instruction_print(const GDecInstruction *instr, GCodeBuffer *buffer, instr->print(instr, buffer, line, output); } + + +/* ---------------------------------------------------------------------------------- */ +/* TRAITEMENT DES INSTRUCTIONS PAR ENSEMBLE */ +/* ---------------------------------------------------------------------------------- */ + + +/****************************************************************************** +* * +* Paramètres : list = liste d'instructions à consulter. * +* * +* Description : Fournit la dernière instruction décompilée de l'ensemble. * +* * +* Retour : Instruction en queue de liste. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GDecInstruction *g_dec_instruction_get_last(GDecInstruction *list) +{ + return dinstr_list_last(list); + +} + + +/****************************************************************************** +* * +* Paramètres : list = liste d'instructions à compléter, ou NULL. * +* instr = nouvelle instruction à intégrer à l'ensemble. * +* * +* Description : Ajoute une instruction à un ensemble existant. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_dec_instruction_add_to_list(GDecInstruction **list, GDecInstruction *instr) +{ + dinstr_list_add_tail(instr, list); + +} + + +/****************************************************************************** +* * +* Paramètres : list = liste d'instructions à modifier. * +* instr = instruction à faire disparaître. * +* * +* Description : Supprime une instruction de l'ensemble décompilé. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_dec_instruction_delete(GDecInstruction **list, GDecInstruction *instr) +{ + dinstr_list_del(instr, list); + +} + + +/****************************************************************************** +* * +* Paramètres : list = liste d'instructions à consulter. * +* : iter = position actuelle dans la liste. * +* * +* Description : Fournit l'élement suivant un autre pour un parcours. * +* * +* Retour : Elément suivant ou NULL si aucun. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GDecInstruction *g_dec_instruction_get_next_iter(const GDecInstruction *list, const GDecInstruction *iter) +{ + return dinstr_list_next_iter(iter, list); + +} + + +/****************************************************************************** +* * +* Paramètres : list = liste d'instructions à consulter. * +* : iter = position actuelle dans la liste. * +* * +* Description : Fournit l'élement précédant un autre pour un parcours. * +* * +* Retour : Elément suivant ou NULL si aucun. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GDecInstruction *g_dec_instruction_get_prev_iter(const GDecInstruction *list, const GDecInstruction *iter) +{ + return dinstr_list_prev_iter(iter, list); + +} |