From: <enl...@li...> - 2003-01-24 15:37:01
|
Enlightenment CVS committal Author : raster Project : e17 Module : libs/ecore Dir : e17/libs/ecore/src/lib/ecore Modified Files: Tag: SPLIT ecore.c ecore_private.h Log Message: complain... basics. need to hook it in =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Attic/ecore.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -3 -r1.1.2.2 -r1.1.2.3 --- ecore.c 16 Jan 2003 11:56:53 -0000 1.1.2.2 +++ ecore.c 24 Jan 2003 15:36:24 -0000 1.1.2.3 @@ -1,6 +1,8 @@ #include "ecore_private.h" #include "Ecore.h" +static char *_ecore_magic_string_get(Ecore_Magic m); + /** * Set up connections, signal handlers, sockets etc. * @return 1 on success, 0 otherwise @@ -22,4 +24,55 @@ void ecore_shutdown(void) { +} + +void +_ecore_magic_fail(void *d, Ecore_Magic m, Ecore_Magic req_m) +{ + fprintf(stderr, "*** ECORE ERROR: Ecore Magic Check Failed!!!\n"); + if (!d) + fprintf(stderr, " Input handle pointer is NULL!\n"); + else if (m == ECORE_MAGIC_NONE) + fprintf(stderr, " Input handle has already been freed!\n"); + else if (m != req_m) + fprintf(stderr, " Input handle is wrong type\n" + " Expected: %08x - %s\n" + " Supplied: %08x - %s\n", + req_m, _ecore_magic_string_get(req_m), + m, _ecore_magic_string_get(m)); +} + +static char * +_ecore_magic_string_get(Ecore_Magic m) +{ + switch (m) + { + case ECORE_MAGIC_NONE: + return "None (Freed Object)"; + break; + case ECORE_MAGIC_EXE: + return "Ecore_Exe (Executable)"; + break; + case ECORE_MAGIC_TIMER: + return "Ecore_Timer (Timer)"; + break; + case ECORE_MAGIC_IDLER: + return "Ecore_Idler (Idler)"; + break; + case ECORE_MAGIC_IDLE_ENTERER: + return "Ecore_Idle_Enterer (Idler Enterer)"; + break; + case ECORE_MAGIC_FD_HANDLER: + return "Ecore_Fd_Handler (Fd Handler)"; + break; + case ECORE_MAGIC_EVENT_HANDLER: + return "Ecore_Event_Handler (Event Handler)"; + break; + case ECORE_MAGIC_EVENT: + return "Ecore_Event (Event)"; + break; + default: + return "<UNKNOWN>"; + }; + return "<UNKNOWN>"; } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/Attic/ecore_private.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -3 -r1.1.2.4 -r1.1.2.5 --- ecore_private.h 23 Jan 2003 23:51:41 -0000 1.1.2.4 +++ ecore_private.h 24 Jan 2003 15:36:25 -0000 1.1.2.5 @@ -28,6 +28,7 @@ #define ECORE_MAGIC_SET(d, m) (d)->__magic = (m) #define ECORE_MAGIC_CHECK(d, m) ((d) && ((d)->__magic == (m))) +#define ECORE_MAGIC_FAIL(d, m) _ecore_magic_fail((d), (d) ? (d)->__magic : 0, (m)); typedef int Ecore_Magic; @@ -119,7 +120,9 @@ void *data; }; -double _ecore_timer_next_get(void); +void _ecore_magic_fail(void *d, Ecore_Magic m, Ecore_Magic req_m); + +double _ecore_timer_next_get(void); int _ecore_timer_call(double when); int _ecore_idler_call(void); @@ -151,11 +154,11 @@ Ecore_Exe *_ecore_exe_find(pid_t pid); void *_ecore_exe_free(Ecore_Exe *exe); -void *_ecore_list_append (void *in_list, void *in_item); -void *_ecore_list_prepend (void *in_list, void *in_item); -void *_ecore_list_append_relative (void *in_list, void *in_item, void *in_relative); -void *_ecore_list_prepend_relative (void *in_list, void *in_item, void *in_relative); -void *_ecore_list_remove (void *in_list, void *in_item); -void *_ecore_list_find (void *in_list, void *in_item); +void *_ecore_list_append (void *in_list, void *in_item); +void *_ecore_list_prepend (void *in_list, void *in_item); +void *_ecore_list_append_relative (void *in_list, void *in_item, void *in_relative); +void *_ecore_list_prepend_relative (void *in_list, void *in_item, void *in_relative); +void *_ecore_list_remove (void *in_list, void *in_item); +void *_ecore_list_find (void *in_list, void *in_item); #endif |