1 /* 2 ** USEFUL.H -- Some useful stuff. 3 ** 4 ** @(#)useful.h 3.10 06/07/82 5 */ 6 7 # ifndef makedev 8 # include <sys/param.h> 9 # endif 10 11 /* support for bool type */ 12 typedef char bool; 13 # define TRUE 1 14 # define FALSE 0 15 16 # ifndef NULL 17 # define NULL 0 18 # endif NULL 19 20 /* bit hacking */ 21 # define bitset(bit, word) (((word) & (bit)) != 0) 22 23 /* assertions */ 24 # ifndef NASSERT 25 # define ASSERT(expr, msg, parm)\ 26 if (!(expr))\ 27 {\ 28 fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\ 29 fprintf(stderr, msg, parm);\ 30 } 31 # else NASSERT 32 # define ASSERT(expr, msg, parm) 33 # endif NASSERT 34 35 /* sccs id's */ 36 # ifndef lint 37 # define SCCSID(arg) static char SccsId[] = "arg"; 38 # else lint 39 # define SCCSID(arg) 40 # endif lint 41 42 /* define the types of some common functions */ 43 extern char *strcpy(), *strncpy(); 44 extern char *strcat(), *strncat(); 45 extern char *malloc(); 46 extern char *index(), *rindex(); 47 extern int errno; 48 extern char *sprintf(); 49 extern time_t time(); 50 extern char *ctime(); 51 # ifndef V6 52 extern char *getenv(); 53 # endif V6 54 # ifndef VMUNIX 55 typedef char *u_short; 56 typedef long u_long; 57 typedef char u_char; 58 typedef int void; 59 # endif VMUNIX 60