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