Wed, 27 Feb 2013 11:37:27 +0100
removed brain-afk code
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@69 | 16 | #define restrict |
universe@65 | 17 | #endif |
olaf@5 | 18 | extern "C" { |
olaf@5 | 19 | #endif |
olaf@5 | 20 | |
universe@26 | 21 | #define UCX_FOREACH(type,list,elem) \ |
universe@26 | 22 | for (type elem = list ; elem != NULL ; elem = elem->next) |
universe@69 | 23 | |
universe@18 | 24 | /* element1,element2,custom data -> {-1,0,1} */ |
universe@18 | 25 | typedef int(*cmp_func)(void*,void*,void*); |
universe@18 | 26 | |
universe@18 | 27 | /* element,custom data -> copy of element */ |
universe@18 | 28 | typedef void*(*copy_func)(void*,void*); |
universe@18 | 29 | |
olaf@76 | 30 | /* buffer, element size, element count, stream */ |
olaf@76 | 31 | typedef size_t(*write_func)(const void*, size_t, size_t, void*); |
olaf@76 | 32 | |
olaf@76 | 33 | /* buffer, element size, element count, stream */ |
olaf@76 | 34 | typedef size_t(*read_func)(void*, size_t, size_t, void*); |
olaf@76 | 35 | |
olaf@5 | 36 | #ifdef __cplusplus |
olaf@5 | 37 | } |
olaf@5 | 38 | #endif |
olaf@5 | 39 | |
olaf@5 | 40 | #endif /* UCX_H */ |
olaf@5 | 41 |