diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-07-18 15:41:02 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-07-18 15:41:02 (GMT) |
commit | 3a9fe39c6a8923f45e7c96d80b0bfe52b8686ff9 (patch) | |
tree | 30c3bfa3df145a74d3237513b9eb6dc5559d32be /src/analysis/prototype.c | |
parent | 10105a5f877fd2c6d1e67343956269f1b19a5133 (diff) |
Computed the end of routines with no limit.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@98 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
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. * |