blob: e5e21de6e5b5921fd91142cdaf1eee8d47564e59 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 */
|