From 296739cd7d4b7cf1eca03bff9f304d94b8c4b44f Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 8 Apr 2011 06:11:31 +0000 Subject: [PATCH] doxy to h. SVN revision: 58473 --- legacy/evas/src/lib/Evas.h | 54 +++++++++++++++++++++++++++++++++++++- legacy/evas/src/lib/main.c | 51 ----------------------------------- 2 files changed, 53 insertions(+), 52 deletions(-) diff --git a/legacy/evas/src/lib/Evas.h b/legacy/evas/src/lib/Evas.h index df175a5bd0..8c39345d76 100644 --- a/legacy/evas/src/lib/Evas.h +++ b/legacy/evas/src/lib/Evas.h @@ -657,7 +657,59 @@ typedef void (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type t EAPI int evas_init (void); EAPI int evas_shutdown (void); - EAPI Evas_Alloc_Error evas_alloc_error (void); + +/** + * Return if any allocation errors have occurred during the prior function + * @return The allocation error flag + * + * This function will return if any memory allocation errors occurred during, + * and what kind they were. The return value will be one of + * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED + * with each meaning something different. + * + * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function + * worked as expected. + * + * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform + * its job and will have exited as cleanly as possible. The programmer + * should consider this as a sign of very low memory and should try and safely + * recover from the prior functions failure (or try free up memory elsewhere + * and try again after more memory is freed). + * + * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was + * recovered from by evas finding memory of its own it has allocated and + * freeing what it sees as not really usefully allocated memory. What is freed + * may vary. Evas may reduce the resolution of images, free cached images or + * fonts, trhow out pre-rendered data, reduce the complexity of change lists + * etc. Evas and the program will function as per normal after this, but this + * is a sign of low memory, and it is suggested that the program try and + * identify memory it doesn't need, and free it. + * + * Example: + * @code + * extern Evas_Object *object; + * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info); + * + * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL); + * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL) + * { + * fprintf(stderr, "ERROR: Completely unable to attach callabck. Must\n"); + * fprintf(stderr, " destroy object now as it cannot be used.\n"); + * evas_object_del(object); + * object = NULL; + * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n"); + * my_memory_cleanup(); + * } + * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED) + * { + * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n"); + * my_memory_cleanup(); + * } + * @endcode + * + * @ingroup Evas_Group + */ +EAPI Evas_Alloc_Error evas_alloc_error (void); EAPI int evas_async_events_fd_get (void) EINA_WARN_UNUSED_RESULT EINA_PURE; EAPI int evas_async_events_process (void); diff --git a/legacy/evas/src/lib/main.c b/legacy/evas/src/lib/main.c index f73d39726e..6e1aa51e53 100644 --- a/legacy/evas/src/lib/main.c +++ b/legacy/evas/src/lib/main.c @@ -9,57 +9,6 @@ static int _evas_debug_init = 0; static int _evas_debug_show = 0; static int _evas_debug_abort = 0; -/** - * Return if any allocation errors have occurred during the prior function - * @return The allocation error flag - * - * This function will return if any memory allocation errors occurred during, - * and what kind they were. The return value will be one of - * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED - * with each meaning something different. - * - * EVAS_ALLOC_ERROR_NONE means that no errors occurred at all and the function - * worked as expected. - * - * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform - * its job and will have exited as cleanly as possible. The programmer - * should consider this as a sign of very low memory and should try and safely - * recover from the prior functions failure (or try free up memory elsewhere - * and try again after more memory is freed). - * - * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occurred, but was - * recovered from by evas finding memory of its own it has allocated and - * freeing what it sees as not really usefully allocated memory. What is freed - * may vary. Evas may reduce the resolution of images, free cached images or - * fonts, trhow out pre-rendered data, reduce the complexity of change lists - * etc. Evas and the program will function as per normal after this, but this - * is a sign of low memory, and it is suggested that the program try and - * identify memory it doesn't need, and free it. - * - * Example: - * @code - * extern Evas_Object *object; - * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info); - * - * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL); - * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL) - * { - * fprintf(stderr, "ERROR: Completely unable to attach callabck. Must\n"); - * fprintf(stderr, " destroy object now as it cannot be used.\n"); - * evas_object_del(object); - * object = NULL; - * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n"); - * my_memory_cleanup(); - * } - * if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED) - * { - * fprintf(stderr, "WARNING: Memory is really low. Cleaning out RAM.\n"); - * my_memory_cleanup(); - * } - * @endcode - * - * @ingroup Evas_Group - */ EAPI Evas_Alloc_Error evas_alloc_error(void) {