diff options
Diffstat (limited to 'src/analysis/prototype.c')
-rw-r--r-- | src/analysis/prototype.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/analysis/prototype.c b/src/analysis/prototype.c index d68a485..72ee809 100644 --- a/src/analysis/prototype.c +++ b/src/analysis/prototype.c @@ -161,6 +161,59 @@ void g_binary_routine_finalize(GBinRoutine *routine) } #endif + +/****************************************************************************** +* * +* Paramètres : a = premières informations à consulter. * +* b = secondes informations à consulter. * +* * +* Description : Etablit la comparaison ascendante entre deux routines. * +* * +* Retour : Bilan : -1 (a < b), 0 (a == b) ou 1 (a > b). * +* * +* Remarques : - * +* * +******************************************************************************/ + +int g_binary_routine_compare(const GBinRoutine **a, const GBinRoutine **b) +{ + int result; /* Bilan à renvoyer */ + + if ((*a)->addr < (*b)->addr) result = -1; + else if((*a)->addr > (*b)->addr) result = 1; + else result = 0; + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : a = premières informations à consulter. * +* b = secondes informations à consulter. * +* * +* Description : Etablit la comparaison descendante entre deux routines. * +* * +* Retour : Bilan : -1 (a < b), 0 (a == b) ou 1 (a > b). * +* * +* Remarques : - * +* * +******************************************************************************/ + +int g_binary_routine_rcompare(const GBinRoutine **a, const GBinRoutine **b) +{ + int result; /* Bilan à renvoyer */ + + if ((*a)->addr > (*b)->addr) result = -1; + else if((*a)->addr < (*b)->addr) result = 1; + else result = 0; + + return result; + +} + + /****************************************************************************** * * * Paramètres : routine = routine à mettre à jour. * |