#ifndef UTIL_H #define UTIL_H #include #include #include #include #define ARRSIZE(x) (sizeof(x)/sizeof((x)[0])) #define MIN(x,y) ((x) > (y) ? (y) : (x)) #define MAX(x,y) ((x) < (y) ? (y) : (x)) #define NULLFREE(p) do { free(p); p = NULL; } while (0) #define MHASHLEN 32 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 */