From: handa Date: Fri, 4 Jun 2004 11:43:18 +0000 (+0000) Subject: (mdebug__register_object, mdebug__unregister_object): X-Git-Tag: withdl~107 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3497a30453584bf88d4bb5cabbb87f8bf5ad6cf;p=m17n%2Fm17n-lib.git (mdebug__register_object, mdebug__unregister_object): Extern them. (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them respectively. --- diff --git a/src/internal.h b/src/internal.h index 5352700..e009d86 100644 --- a/src/internal.h +++ b/src/internal.h @@ -341,36 +341,19 @@ typedef struct void **objects; } M17NObjectArray; +extern void mdebug__register_object (M17NObjectArray *array, void *object); -#define M17N_OBJECT_REGISTER(array, object) \ - if (mdebug__flag & MDEBUG_FINI) \ - { \ - if ((array).used == 0) \ - MLIST_INIT1 (&(array), objects, 256); \ - (array).count++; \ - MLIST_APPEND1 (&(array), objects, object, MERROR_OBJECT); \ - } \ +#define M17N_OBJECT_REGISTER(array, object) \ + if (mdebug__flag & MDEBUG_FINI) \ + mdebug__register_object (&array, object); \ else -#define M17N_OBJECT_UNREGISTER(array, object) \ - if (mdebug__flag & MDEBUG_FINI) \ - { \ - (array).count--; \ - if ((array).count >= 0) \ - { \ - int i = 0; \ - \ - while (i < (array).used && (array).objects[i] != object) i++; \ - if (i < (array).used) \ - (array).objects[i] = NULL; \ - else \ - mdebug_hook (); \ - } \ - else \ - mdebug_hook (); \ - } \ - else +extern void mdebug__unregister_object (M17NObjectArray *array, void *object); +#define M17N_OBJECT_UNREGISTER(array, object) \ + if (mdebug__flag & MDEBUG_FINI) \ + mdebug__unregister_object (&array, object); \ + else extern void mdebug__report_object (char *name, M17NObjectArray *array);