diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/eina/src/lib/eina_private.h | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/libraries/eina/src/lib/eina_private.h b/libraries/eina/src/lib/eina_private.h new file mode 100644 index 0000000..d390397 --- /dev/null +++ b/libraries/eina/src/lib/eina_private.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* EINA - EFL data type library | ||
2 | * Copyright (C) 2008 Carsten Haitzler, Vincent Torri, Jorge Luis Zapata Muga | ||
3 | * | ||
4 | * This library is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2.1 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This library is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library; | ||
16 | * if not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifndef EINA_PRIVATE_H_ | ||
20 | #define EINA_PRIVATE_H_ | ||
21 | |||
22 | #include <stdarg.h> | ||
23 | |||
24 | #include "eina_magic.h" | ||
25 | #include "eina_iterator.h" | ||
26 | #include "eina_accessor.h" | ||
27 | |||
28 | #ifndef MIN | ||
29 | # define MIN(x, y) (((x) > (y)) ? (y) : (x)) | ||
30 | #endif | ||
31 | |||
32 | #ifndef MAX | ||
33 | # define MAX(x, y) (((x) > (y)) ? (x) : (y)) | ||
34 | #endif | ||
35 | |||
36 | #ifndef ABS | ||
37 | # define ABS(x) ((x) < 0 ? -(x) : (x)) | ||
38 | #endif | ||
39 | |||
40 | #ifndef CLAMP | ||
41 | # define CLAMP(x, min, \ | ||
42 | max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x))) | ||
43 | #endif | ||
44 | |||
45 | #define EINA_INLIST_JUMP_SIZE 256 | ||
46 | |||
47 | #define READBUFSIZ 65536 | ||
48 | |||
49 | #define EINA_LOG_COLOR_DEFAULT "\033[36m" | ||
50 | |||
51 | /* eina magic types */ | ||
52 | #define EINA_MAGIC_SHARE 0x98761234 | ||
53 | #define EINA_MAGIC_SHARE_HEAD 0x98761235 | ||
54 | #define EINA_MAGIC_STRINGSHARE_NODE 0x98761254 | ||
55 | #define EINA_MAGIC_USTRINGSHARE_NODE 0x98761255 | ||
56 | #define EINA_MAGIC_BINSHARE_NODE 0x98761256 | ||
57 | |||
58 | #define EINA_MAGIC_LIST 0x98761237 | ||
59 | #define EINA_MAGIC_LIST_ITERATOR 0x98761238 | ||
60 | #define EINA_MAGIC_LIST_ACCESSOR 0x98761239 | ||
61 | #define EINA_MAGIC_LIST_ACCOUNTING 0x9876123a | ||
62 | |||
63 | #define EINA_MAGIC_ARRAY 0x9876123b | ||
64 | #define EINA_MAGIC_ARRAY_ITERATOR 0x9876123c | ||
65 | #define EINA_MAGIC_ARRAY_ACCESSOR 0x9876123d | ||
66 | |||
67 | #define EINA_MAGIC_HASH 0x9876123e | ||
68 | #define EINA_MAGIC_HASH_ITERATOR 0x9876123f | ||
69 | |||
70 | #define EINA_MAGIC_TILER 0x98761240 | ||
71 | #define EINA_MAGIC_TILER_ITERATOR 0x98761241 | ||
72 | |||
73 | #define EINA_MAGIC_MATRIXSPARSE 0x98761242 | ||
74 | #define EINA_MAGIC_MATRIXSPARSE_ROW 0x98761243 | ||
75 | #define EINA_MAGIC_MATRIXSPARSE_CELL 0x98761244 | ||
76 | #define EINA_MAGIC_MATRIXSPARSE_ITERATOR 0x98761245 | ||
77 | #define EINA_MAGIC_MATRIXSPARSE_ROW_ITERATOR 0x98761246 | ||
78 | #define EINA_MAGIC_MATRIXSPARSE_ROW_ACCESSOR 0x98761247 | ||
79 | #define EINA_MAGIC_MATRIXSPARSE_CELL_ITERATOR 0x98761248 | ||
80 | #define EINA_MAGIC_MATRIXSPARSE_CELL_ACCESSOR 0x98761249 | ||
81 | |||
82 | #define EINA_MAGIC_STRBUF 0x98761250 | ||
83 | #define EINA_MAGIC_USTRBUF 0x98761257 | ||
84 | #define EINA_MAGIC_BINBUF 0x98761258 | ||
85 | |||
86 | #define EINA_MAGIC_QUADTREE 0x98761251 | ||
87 | #define EINA_MAGIC_QUADTREE_ROOT 0x98761252 | ||
88 | #define EINA_MAGIC_QUADTREE_ITEM 0x98761253 | ||
89 | |||
90 | #define EINA_MAGIC_SIMPLE_XML_TAG 0x98761260 | ||
91 | #define EINA_MAGIC_SIMPLE_XML_DATA 0x98761261 | ||
92 | #define EINA_MAGIC_SIMPLE_XML_ATTRIBUTE 0x98761262 | ||
93 | |||
94 | #define EINA_MAGIC_CLASS 0x9877CB30 | ||
95 | |||
96 | /* undef the following, we want out version */ | ||
97 | #undef FREE | ||
98 | #define FREE(ptr) \ | ||
99 | do { \ | ||
100 | free(ptr); \ | ||
101 | ptr = NULL; \ | ||
102 | } while(0); | ||
103 | |||
104 | #undef IF_FREE | ||
105 | #define IF_FREE(ptr) \ | ||
106 | do { \ | ||
107 | if (ptr) { \ | ||
108 | free(ptr); \ | ||
109 | ptr = NULL; \ | ||
110 | } \ | ||
111 | } while(0); | ||
112 | |||
113 | #undef IF_FN_DEL | ||
114 | #define IF_FN_DEL(_fn, ptr) \ | ||
115 | do { \ | ||
116 | if (ptr) { \ | ||
117 | _fn(ptr); \ | ||
118 | ptr = NULL; \ | ||
119 | } \ | ||
120 | } while(0); | ||
121 | |||
122 | #define MAGIC_FREE(ptr) \ | ||
123 | do { \ | ||
124 | if (ptr) { \ | ||
125 | EINA_MAGIC_SET(ptr, EINA_MAGIC_NONE); \ | ||
126 | FREE(ptr); \ | ||
127 | } \ | ||
128 | } while(0); | ||
129 | |||
130 | #ifdef EFL_HAVE_THREADS | ||
131 | extern Eina_Bool _threads_activated; | ||
132 | |||
133 | void eina_share_common_threads_init(void); | ||
134 | void eina_share_common_threads_shutdown(void); | ||
135 | void eina_log_threads_init(void); | ||
136 | void eina_log_threads_shutdown(void); | ||
137 | #endif | ||
138 | |||
139 | #endif /* EINA_PRIVATE_H_ */ | ||
140 | |||