summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-05-22 02:49:50 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-05-22 02:49:50 +0000
commit46e02cf8bb14545bf73586145d52603b8fafd435 (patch)
tree01e271f53f8c8365bcad7195b3a55fa7ab54dbf5 /legacy/evas/src/lib/main.c
parent2a6937cccbf90e16710dc46562249fb3d9405f39 (diff)
whitespace
SVN revision: 14889
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/main.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/legacy/evas/src/lib/main.c b/legacy/evas/src/lib/main.c
index 61e231c7ed..957fbb6acc 100644
--- a/legacy/evas/src/lib/main.c
+++ b/legacy/evas/src/lib/main.c
@@ -10,21 +10,21 @@ static int _evas_debug_abort = 0;
10/** 10/**
11 * Return if any allocation errors have occured during the prior function 11 * Return if any allocation errors have occured during the prior function
12 * @return The allocation error flag 12 * @return The allocation error flag
13 * 13 *
14 * This function will return if any memory allocation errors occured during, 14 * This function will return if any memory allocation errors occured during,
15 * and what kind they were. The return value will be one of 15 * and what kind they were. The return value will be one of
16 * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED 16 * EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED
17 * with each meaning something different. 17 * with each meaning something different.
18 * 18 *
19 * EVAS_ALLOC_ERROR_NONE means that no errors occured at all and the function 19 * EVAS_ALLOC_ERROR_NONE means that no errors occured at all and the function
20 * worked as expected. 20 * worked as expected.
21 * 21 *
22 * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform 22 * EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform
23 * its job and will have exited as cleanly as possible. The programmer 23 * its job and will have exited as cleanly as possible. The programmer
24 * should consider this as a sign of very low memory and should try and safely 24 * should consider this as a sign of very low memory and should try and safely
25 * recover from the prior functions failure (or try free up memory elsewhere 25 * recover from the prior functions failure (or try free up memory elsewhere
26 * and try again after more memory is freed). 26 * and try again after more memory is freed).
27 * 27 *
28 * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occured, but was 28 * EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occured, but was
29 * recovered from by evas finding memory of its own it has allocated and 29 * recovered from by evas finding memory of its own it has allocated and
30 * freeing what it sees as not really usefully allocated memory. What is freed 30 * freeing what it sees as not really usefully allocated memory. What is freed
@@ -33,12 +33,12 @@ static int _evas_debug_abort = 0;
33 * etc. Evas and the program will function as per normal after this, but this 33 * etc. Evas and the program will function as per normal after this, but this
34 * is a sign of low memory, and it is suggested that the program try and 34 * is a sign of low memory, and it is suggested that the program try and
35 * identify memory it doesn't need, and free it. 35 * identify memory it doesn't need, and free it.
36 * 36 *
37 * Example: 37 * Example:
38 * @code 38 * @code
39 * extern Evas_Object *object; 39 * extern Evas_Object *object;
40 * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info); 40 * void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
41 * 41 *
42 * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL); 42 * evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
43 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL) 43 * if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
44 * { 44 * {
@@ -80,13 +80,13 @@ void *
80evas_mem_calloc(int size) 80evas_mem_calloc(int size)
81{ 81{
82 void *ptr; 82 void *ptr;
83 83
84 ptr = calloc(1, size); 84 ptr = calloc(1, size);
85 if (ptr) return ptr; 85 if (ptr) return ptr;
86 MERR_BAD(); 86 MERR_BAD();
87 while ((!ptr) && (evas_mem_free(size))) ptr = calloc(1, size); 87 while ((!ptr) && (evas_mem_free(size))) ptr = calloc(1, size);
88 if (ptr) return ptr; 88 if (ptr) return ptr;
89 while ((!ptr) && (evas_mem_degrade(size))) ptr = calloc(1, size); 89 while ((!ptr) && (evas_mem_degrade(size))) ptr = calloc(1, size);
90 if (ptr) return ptr; 90 if (ptr) return ptr;
91 MERR_FATAL(); 91 MERR_FATAL();
92 return NULL; 92 return NULL;
@@ -102,7 +102,7 @@ evas_debug_error(void)
102 _evas_debug_init = 1; 102 _evas_debug_init = 1;
103 } 103 }
104 if (_evas_debug_show) 104 if (_evas_debug_show)
105 fprintf(stderr, 105 fprintf(stderr,
106 "*** EVAS ERROR: Evas Magic Check Failed!!!\n"); 106 "*** EVAS ERROR: Evas Magic Check Failed!!!\n");
107} 107}
108 108
@@ -116,7 +116,7 @@ evas_debug_input_null(void)
116 _evas_debug_init = 1; 116 _evas_debug_init = 1;
117 } 117 }
118 if (_evas_debug_show) 118 if (_evas_debug_show)
119 fprintf(stderr, 119 fprintf(stderr,
120 " Input object pointer is NULL!\n"); 120 " Input object pointer is NULL!\n");
121 if (_evas_debug_abort) abort(); 121 if (_evas_debug_abort) abort();
122} 122}
@@ -131,7 +131,7 @@ evas_debug_magic_null(void)
131 _evas_debug_init = 1; 131 _evas_debug_init = 1;
132 } 132 }
133 if (_evas_debug_show) 133 if (_evas_debug_show)
134 fprintf(stderr, 134 fprintf(stderr,
135 " Input object is zero'ed out (maybe a freed object or zero-filled RAM)!\n"); 135 " Input object is zero'ed out (maybe a freed object or zero-filled RAM)!\n");
136 if (_evas_debug_abort) abort(); 136 if (_evas_debug_abort) abort();
137} 137}
@@ -146,7 +146,7 @@ evas_debug_magic_wrong(DATA32 expected, DATA32 supplied)
146 _evas_debug_init = 1; 146 _evas_debug_init = 1;
147 } 147 }
148 if (_evas_debug_show) 148 if (_evas_debug_show)
149 fprintf(stderr, 149 fprintf(stderr,
150 " Input object is wrong type\n" 150 " Input object is wrong type\n"
151 " Expected: %08x - %s\n" 151 " Expected: %08x - %s\n"
152 " Supplied: %08x - %s\n", 152 " Supplied: %08x - %s\n",
@@ -165,7 +165,7 @@ evas_debug_generic(const char *str)
165 _evas_debug_init = 1; 165 _evas_debug_init = 1;
166 } 166 }
167 if (_evas_debug_show) 167 if (_evas_debug_show)
168 fprintf(stderr, 168 fprintf(stderr,
169 "*** EVAS ERROR:\n" 169 "*** EVAS ERROR:\n"
170 "%s", (char *)str); 170 "%s", (char *)str);
171 if (_evas_debug_abort) abort(); 171 if (_evas_debug_abort) abort();