ctdb-logging: Factor out ctdb_logging.h from includes.h
[Samba.git] / ctdb / include / internal / includes.h
blobe3e153b9a9223d9def28088960836982c697b88a
1 #ifndef _CTDB_INCLUDES_H
2 #define _CTDB_INCLUDES_H
4 #define HAVE_UNIXSOCKET 1
6 #include "replace.h"
7 #include "talloc.h"
8 #include "system/wait.h"
9 #include "system/network.h"
10 #include "tdb.h"
11 #include "idtree.h"
12 #include "ctdb_client.h"
14 /* Allow use of deprecated function tevent_loop_allow_nesting() */
15 #define TEVENT_DEPRECATED
16 /* Saves ctdb from massive churn. */
17 #define TEVENT_COMPAT_DEFINES 1
19 #include "tevent.h"
21 #include "ctdb_logging.h"
23 #ifndef _PUBLIC_
24 #define _PUBLIC_
25 #endif /* _PUBLIC_ */
26 #ifndef _NORETURN_
27 #define _NORETURN_
28 #endif /* _NORETURN_ */
29 #ifndef _PURE_
30 #define _PURE_
31 #endif /* _PURE_ */
33 #ifndef ZERO_STRUCT
34 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
35 #endif /* ZERO_STRUCT */
37 #ifndef discard_const
38 #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
39 #endif
41 struct timeval timeval_zero(void);
42 bool timeval_is_zero(const struct timeval *tv);
43 struct timeval timeval_current(void);
44 struct timeval timeval_set(uint32_t secs, uint32_t usecs);
45 int timeval_compare(const struct timeval *tv1, const struct timeval *tv2);
46 struct timeval timeval_until(const struct timeval *tv1,
47 const struct timeval *tv2);
48 _PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs);
49 double timeval_elapsed(struct timeval *tv);
50 char **file_lines_load(const char *fname, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
51 char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
52 _PUBLIC_ int set_blocking(int fd, bool set);
54 #include "lib/util/debug.h"
55 #include "lib/util/util.h"
57 #endif /* _CTDB_INCLUDES_H */