r24712: No longer expose the 'BOOL' data type in any interfaces.
[metze/samba/wip.git] / source4 / cluster / ctdb / include / includes.h
1 #define HAVE_UNIXSOCKET 1
2
3 #include "replace.h"
4 #include "talloc.h"
5 #include "tdb.h"
6 #include "idtree.h"
7 #include "ctdb.h"
8 #include "lib/util/debug.h"
9
10 typedef bool BOOL;
11
12 #define True 1
13 #define False 0
14
15 extern int LogLevel;
16
17 #define DEBUG(lvl, x) if ((lvl) <= LogLevel) (do_debug x)
18
19 #define _PUBLIC_
20
21 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
22
23 #ifndef discard_const
24 #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
25 #endif
26
27 struct timeval timeval_zero(void);
28 bool timeval_is_zero(const struct timeval *tv);
29 struct timeval timeval_current(void);
30 struct timeval timeval_set(uint32_t secs, uint32_t usecs);
31 int timeval_compare(const struct timeval *tv1, const struct timeval *tv2);
32 struct timeval timeval_until(const struct timeval *tv1,
33                              const struct timeval *tv2);
34 _PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs);
35 double timeval_elapsed(struct timeval *tv);
36 char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx);
37 char *hex_encode(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
38 _PUBLIC_ const char **str_list_add(const char **list, const char *s);
39 _PUBLIC_ int set_blocking(int fd, bool set);
40