Wed, 10 Oct 2012 14:26:53 +0200
added _Bool macro for cplusplus
1 /*
2 * File: ucx.h
3 * Author: olaf
4 *
5 * Created on 31. Dezember 2011, 17:17
6 */
8 #ifndef UCX_H
9 #define UCX_H
11 #include <stdlib.h>
13 #ifdef __cplusplus
14 #ifndef _Bool
15 #define _Bool bool
16 #endif
17 extern "C" {
18 #endif
20 #define UCX_FOREACH(type,list,elem) \
21 for (type elem = list ; elem != NULL ; elem = elem->next)
23 /* element1,element2,custom data -> {-1,0,1} */
24 typedef int(*cmp_func)(void*,void*,void*);
26 /* element,custom data -> copy of element */
27 typedef void*(*copy_func)(void*,void*);
29 #ifdef __cplusplus
30 }
31 #endif
33 #endif /* UCX_H */