diff options
Diffstat (limited to 'service/src/util.h')
| -rw-r--r-- | service/src/util.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/service/src/util.h b/service/src/util.h new file mode 100644 index 0000000..e5e21de --- /dev/null +++ b/service/src/util.h @@ -0,0 +1,20 @@ +#ifndef UTIL_H +#define UTIL_H + +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <stdio.h> + +#define ARRSIZE(x) (sizeof(x)/sizeof((x)[0])) +#define MIN(x,y) ((x) > (y) ? (y) : (x)) +#define NULLFREE(p) do { free(p); p = NULL; } while (0) + +enum { FAIL = 0, OK = 1 }; + +void* checkp(void *p); +void* die(const char *fmtstr, ...); +char* aprintf(const char *fmtstr, ...); +const char* mhash(const char *filename, int len); + +#endif /* UTIL_H */ |
