Enlightenment CVS committal Author : cedric Project : e17 Module : proto/eina
Dir : e17/proto/eina/src/lib Modified Files: eina_error.c Log Message: Fix error get/set. =================================================================== RCS file: /cvs/e/e17/proto/eina/src/lib/eina_error.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- eina_error.c 30 Jul 2008 13:35:49 -0000 1.2 +++ eina_error.c 1 Aug 2008 14:26:13 -0000 1.3 @@ -12,7 +12,6 @@ /*============================================================================* * Local * *============================================================================*/ -static int _curr = 1; static int _init_count = 0; static Eina_List *_error_list; static int _err; @@ -49,13 +48,6 @@ } } /*============================================================================* - * Global * - *============================================================================*/ -void eina_error_magic_check(unsigned int magic, unsigned int cmp) -{ - assert(magic == cmp); -} -/*============================================================================* * API * *============================================================================*/ /** @@ -63,7 +55,7 @@ */ EAPI int eina_error_init(void) { - if (!_init_count) + if (!_init_count) { char *level; /* TODO register the eina's basic errors */ @@ -81,8 +73,6 @@ */ EAPI int eina_error_shutdown(void) { - if (!_init_count) - return _init_count; _init_count--; if (!_init_count) { @@ -103,12 +93,9 @@ */ EAPI int eina_error_register(const char *msg) { - char *str; - - str = strdup(msg); - _error_list = eina_list_append(_error_list, str); - - return ++_curr; + _error_list = eina_list_append(_error_list, strdup(msg)); + + return eina_list_count(_error_list); } /** * @@ -131,7 +118,7 @@ */ EAPI const char * eina_error_msg_get(int error) { - return eina_list_nth(_error_list, error); + return eina_list_nth(_error_list, error - 1); } /** * @@ -146,9 +133,10 @@ va_end(args); } /** - * + * */ EAPI void eina_error_log_level_set(Eina_Error_Level level) { _error_level = level; } + ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs