diff options
Diffstat (limited to 'libraries/eina/src/include/eina_types.h')
-rw-r--r-- | libraries/eina/src/include/eina_types.h | 300 |
1 files changed, 0 insertions, 300 deletions
diff --git a/libraries/eina/src/include/eina_types.h b/libraries/eina/src/include/eina_types.h deleted file mode 100644 index b0a7cf8..0000000 --- a/libraries/eina/src/include/eina_types.h +++ /dev/null | |||
@@ -1,300 +0,0 @@ | |||
1 | /* EINA - EFL data type library | ||
2 | * Copyright (C) 2007-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_TYPES_H_ | ||
20 | #define EINA_TYPES_H_ | ||
21 | |||
22 | /** | ||
23 | * @addtogroup Eina_Core_Group Core | ||
24 | * | ||
25 | * @{ | ||
26 | */ | ||
27 | |||
28 | /** | ||
29 | * @defgroup Eina_Types_Group Types | ||
30 | * | ||
31 | * @{ | ||
32 | */ | ||
33 | |||
34 | #ifdef EAPI | ||
35 | # undef EAPI | ||
36 | #endif | ||
37 | |||
38 | #ifdef _WIN32 | ||
39 | # ifdef EFL_EINA_BUILD | ||
40 | # ifdef DLL_EXPORT | ||
41 | # define EAPI __declspec(dllexport) | ||
42 | # else | ||
43 | # define EAPI | ||
44 | # endif /* ! DLL_EXPORT */ | ||
45 | # else | ||
46 | # define EAPI __declspec(dllimport) | ||
47 | # endif /* ! EFL_EINA_BUILD */ | ||
48 | #else | ||
49 | # ifdef __GNUC__ | ||
50 | # if __GNUC__ >= 4 | ||
51 | # define EAPI __attribute__ ((visibility("default"))) | ||
52 | # else | ||
53 | # define EAPI | ||
54 | # endif | ||
55 | # else | ||
56 | # define EAPI | ||
57 | # endif | ||
58 | #endif | ||
59 | |||
60 | #include "eina_config.h" | ||
61 | |||
62 | #ifdef EINA_WARN_UNUSED_RESULT | ||
63 | # undef EINA_WARN_UNUSED_RESULT | ||
64 | #endif | ||
65 | #ifdef EINA_ARG_NONNULL | ||
66 | # undef EINA_ARG_NONNULL | ||
67 | #endif | ||
68 | #ifdef EINA_DEPRECATED | ||
69 | # undef EINA_DEPRECATED | ||
70 | #endif | ||
71 | #ifdef EINA_MALLOC | ||
72 | # undef EINA_MALLOC | ||
73 | #endif | ||
74 | #ifdef EINA_PURE | ||
75 | # undef EINA_PURE | ||
76 | #endif | ||
77 | #ifdef EINA_PRINTF | ||
78 | # undef EINA_PRINTF | ||
79 | #endif | ||
80 | #ifdef EINA_SCANF | ||
81 | # undef EINA_SCANF | ||
82 | #endif | ||
83 | #ifdef EINA_FORMAT | ||
84 | # undef EINA_FORMAT | ||
85 | #endif | ||
86 | #ifdef EINA_CONST | ||
87 | # undef EINA_CONST | ||
88 | #endif | ||
89 | #ifdef EINA_NOINSTRUMENT | ||
90 | # undef EINA_NOINSTRUMENT | ||
91 | #endif | ||
92 | #ifdef EINA_UNLIKELY | ||
93 | # undef EINA_UNLIKELY | ||
94 | #endif | ||
95 | #ifdef EINA_LIKELY | ||
96 | # undef EINA_LIKELY | ||
97 | #endif | ||
98 | |||
99 | #ifdef __GNUC__ | ||
100 | # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) | ||
101 | # define EINA_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) | ||
102 | # else | ||
103 | # define EINA_WARN_UNUSED_RESULT | ||
104 | # endif | ||
105 | |||
106 | # if (!defined(EINA_SAFETY_CHECKS)) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) | ||
107 | # define EINA_ARG_NONNULL(idx, ...) __attribute__ ((__nonnull__(idx, ## __VA_ARGS__))) | ||
108 | # else | ||
109 | # define EINA_ARG_NONNULL(idx, ...) | ||
110 | # endif | ||
111 | |||
112 | # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | ||
113 | # define EINA_DEPRECATED __attribute__ ((__deprecated__)) | ||
114 | # else | ||
115 | # define EINA_DEPRECATED | ||
116 | # endif | ||
117 | |||
118 | # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) | ||
119 | # define EINA_MALLOC __attribute__ ((__malloc__)) | ||
120 | # define EINA_PURE __attribute__ ((__pure__)) | ||
121 | # else | ||
122 | # define EINA_MALLOC | ||
123 | # define EINA_PURE | ||
124 | # endif | ||
125 | |||
126 | # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) | ||
127 | # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3) | ||
128 | # define EINA_PRINTF(fmt, arg) __attribute__((__format__ (__gnu_printf__, fmt, arg))) | ||
129 | # else | ||
130 | # define EINA_PRINTF(fmt, arg) __attribute__((__format__ (__printf__, fmt, arg))) | ||
131 | # endif | ||
132 | # define EINA_SCANF(fmt, arg) __attribute__((__format__ (__scanf__, fmt, arg))) | ||
133 | # define EINA_FORMAT(fmt) __attribute__((__format_arg__(fmt))) | ||
134 | # define EINA_CONST __attribute__((__const__)) | ||
135 | # define EINA_NOINSTRUMENT __attribute__((__no_instrument_function__)) | ||
136 | # define EINA_UNLIKELY(exp) __builtin_expect((exp), 0) | ||
137 | # define EINA_LIKELY(exp) __builtin_expect((exp), 1) | ||
138 | # else | ||
139 | # define EINA_PRINTF(fmt, arg) | ||
140 | # define EINA_SCANF(fmt, arg) | ||
141 | # define EINA_FORMAT(fmt) | ||
142 | # define EINA_CONST | ||
143 | # define EINA_NOINSTRUMENT | ||
144 | # define EINA_UNLIKELY(exp) exp | ||
145 | # define EINA_LIKELY(exp) exp | ||
146 | # endif | ||
147 | |||
148 | #elif defined(_WIN32) | ||
149 | # define EINA_WARN_UNUSED_RESULT | ||
150 | # define EINA_ARG_NONNULL(idx, ...) | ||
151 | # if defined(_MSC_VER) && _MSC_VER >= 1300 | ||
152 | # define EINA_DEPRECATED __declspec(deprecated) | ||
153 | # else | ||
154 | # define EINA_DEPRECATED | ||
155 | # endif | ||
156 | # define EINA_MALLOC | ||
157 | # define EINA_PURE | ||
158 | # define EINA_PRINTF(fmt, arg) | ||
159 | # define EINA_SCANF(fmt, arg) | ||
160 | # define EINA_FORMAT(fmt) | ||
161 | # define EINA_CONST | ||
162 | # define EINA_NOINSTRUMENT | ||
163 | # define EINA_UNLIKELY(exp) exp | ||
164 | # define EINA_LIKELY(exp) exp | ||
165 | |||
166 | #elif defined(__SUNPRO_C) | ||
167 | # define EINA_WARN_UNUSED_RESULT | ||
168 | # define EINA_ARG_NONNULL(...) | ||
169 | # define EINA_DEPRECATED | ||
170 | # if __SUNPRO_C >= 0x590 | ||
171 | # define EINA_MALLOC __attribute__ ((malloc)) | ||
172 | # define EINA_PURE __attribute__ ((pure)) | ||
173 | # else | ||
174 | # define EINA_MALLOC | ||
175 | # define EINA_PURE | ||
176 | # endif | ||
177 | # define EINA_PRINTF(fmt, arg) | ||
178 | # define EINA_SCANF(fmt, arg) | ||
179 | # define EINA_FORMAT(fmt) | ||
180 | # if __SUNPRO_C >= 0x590 | ||
181 | # define EINA_CONST __attribute__ ((const)) | ||
182 | # else | ||
183 | # define EINA_CONST | ||
184 | # endif | ||
185 | # define EINA_NOINSTRUMENT | ||
186 | # define EINA_UNLIKELY(exp) exp | ||
187 | # define EINA_LIKELY(exp) exp | ||
188 | |||
189 | #else /* ! __GNUC__ && ! _WIN32 && ! __SUNPRO_C */ | ||
190 | |||
191 | /** | ||
192 | * @def EINA_WARN_UNUSED_RESULT | ||
193 | * Used to warn when the returned value of the function is not used. | ||
194 | */ | ||
195 | # define EINA_WARN_UNUSED_RESULT | ||
196 | |||
197 | /** | ||
198 | * @def EINA_ARG_NONNULL | ||
199 | * Used to warn when the specified arguments of the function are @c NULL. | ||
200 | */ | ||
201 | # define EINA_ARG_NONNULL(idx, ...) | ||
202 | |||
203 | /** | ||
204 | * @def EINA_DEPRECATED | ||
205 | * Used to warn when the function is considered as deprecated. | ||
206 | */ | ||
207 | # define EINA_DEPRECATED | ||
208 | # define EINA_MALLOC | ||
209 | # define EINA_PURE | ||
210 | # define EINA_PRINTF(fmt, arg) | ||
211 | # define EINA_SCANF(fmt, arg) | ||
212 | # define EINA_FORMAT(fmt) | ||
213 | # define EINA_CONST | ||
214 | # define EINA_NOINSTRUMENT | ||
215 | # define EINA_UNLIKELY(exp) exp | ||
216 | # define EINA_LIKELY(exp) exp | ||
217 | #endif /* ! __GNUC__ && ! _WIN32 && ! __SUNPRO_C */ | ||
218 | |||
219 | /** | ||
220 | * @typedef Eina_Bool | ||
221 | * Type to mimic a boolean. | ||
222 | * | ||
223 | * @note it differs from stdbool.h as this is defined as an unsigned | ||
224 | * char to make it usable by bitfields (Eina_Bool name:1) and | ||
225 | * also take as few bytes as possible. | ||
226 | */ | ||
227 | typedef unsigned char Eina_Bool; | ||
228 | |||
229 | /** | ||
230 | * @def EINA_FALSE | ||
231 | * boolean value FALSE (numerical value 0) | ||
232 | */ | ||
233 | #define EINA_FALSE ((Eina_Bool)0) | ||
234 | |||
235 | /** | ||
236 | * @def EINA_TRUE | ||
237 | * boolean value TRUE (numerical value 1) | ||
238 | */ | ||
239 | #define EINA_TRUE ((Eina_Bool)1) | ||
240 | |||
241 | EAPI extern const unsigned int eina_prime_table[]; | ||
242 | |||
243 | /** | ||
244 | * @typedef Eina_Compare_Cb | ||
245 | * Function used in functions using sorting. It compares @p data1 and | ||
246 | * @p data2. If @p data1 is 'less' than @p data2, -1 must be returned, | ||
247 | * if it is 'greater', 1 must be returned, and if they are equal, 0 | ||
248 | * must be returned. | ||
249 | */ | ||
250 | typedef int (*Eina_Compare_Cb)(const void *data1, const void *data2); | ||
251 | |||
252 | /** | ||
253 | * @def EINA_COMPARE_CB | ||
254 | * Macro to cast to Eina_Compare_Cb. | ||
255 | */ | ||
256 | #define EINA_COMPARE_CB(function) ((Eina_Compare_Cb)function) | ||
257 | |||
258 | /** | ||
259 | * @typedef Eina_Each_Cb | ||
260 | * A callback type used when iterating over a container. | ||
261 | */ | ||
262 | typedef Eina_Bool (*Eina_Each_Cb)(const void *container, void *data, void *fdata); | ||
263 | |||
264 | /** | ||
265 | * @def EINA_EACH_CB | ||
266 | * Macro to cast to Eina_Each. | ||
267 | */ | ||
268 | #define EINA_EACH_CB(Function) ((Eina_Each_Cb)Function) | ||
269 | |||
270 | /** | ||
271 | * @typedef Eina_Free_Cb | ||
272 | * A callback type used to free data when iterating over a container. | ||
273 | */ | ||
274 | typedef void (*Eina_Free_Cb)(void *data); | ||
275 | |||
276 | /** | ||
277 | * @def EINA_FREE_CB | ||
278 | * Macro to cast to Eina_Free_Cb. | ||
279 | */ | ||
280 | #define EINA_FREE_CB(Function) ((Eina_Free_Cb)Function) | ||
281 | |||
282 | /** | ||
283 | * @def EINA_C_ARRAY_LENGTH | ||
284 | * Macro to return the array length of a standard c array. | ||
285 | * For example: | ||
286 | * int foo[] = { 0, 1, 2, 3 }; | ||
287 | * would return 4 and not 4 * sizeof(int). | ||
288 | * @since 1.2.0 | ||
289 | */ | ||
290 | #define EINA_C_ARRAY_LENGTH(arr) (sizeof(arr) / sizeof((arr)[0])) | ||
291 | |||
292 | /** | ||
293 | * @} | ||
294 | */ | ||
295 | |||
296 | /** | ||
297 | * @} | ||
298 | */ | ||
299 | |||
300 | #endif /* EINA_TYPES_H_ */ | ||