1 #define HAVE_UNIXSOCKET 1
5 #include "system/wait.h"
6 #include "system/network.h"
10 #include "lib/util/debug.h"
18 extern int this_log_level;
31 #define DEBUGLVL(lvl) ((lvl) <= LogLevel)
32 #define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0)
33 #define DEBUGADD(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug_add x; }} while (0)
37 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
40 #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
43 struct timeval timeval_zero(void);
44 bool timeval_is_zero(const struct timeval *tv);
45 struct timeval timeval_current(void);
46 struct timeval timeval_set(uint32_t secs, uint32_t usecs);
47 int timeval_compare(const struct timeval *tv1, const struct timeval *tv2);
48 struct timeval timeval_until(const struct timeval *tv1,
49 const struct timeval *tv2);
50 _PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs);
51 double timeval_elapsed(struct timeval *tv);
52 double timeval_delta(struct timeval *tv2, struct timeval *tv);
53 char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx);
54 char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
55 _PUBLIC_ const char **str_list_add(const char **list, const char *s);
56 _PUBLIC_ int set_blocking(int fd, BOOL set);