1 /* Some standard utility stuff. */ 2 3 #ifndef UTIL_H 4 #define UTIL_H 5 6 #ifndef TRUE 7 #define TRUE 1 8 #define FALSE 0 9 #endif 10 11 /* Error messages. */ 12 13 extern char *Progname; 14 extern void fatalerr(const char *, ...); 15 extern void msg(const char *, ...); 16 17 /* A function and some macros for allocating memory. */ 18 19 extern void *new_(size_t s); 20 21 #define new(type) (type *)new_(sizeof(type)) 22 #define new_array(type, size) (type *)new_((size) * sizeof(type)) 23 24 /* Files. */ 25 26 extern FILE *fileopen(const char *name, const char *mode); 27 28 /* Conversions. */ 29 30 extern int atoik(char *); 31 32 #endif /* UTIL_H */ 33