1164Seric /* 2164Seric ** USEFUL.H -- Some useful stuff. 3402Seric ** 4*6281Seric ** @(#)useful.h 3.8 03/22/82 5164Seric */ 6164Seric 74148Seric # ifndef makedev 84148Seric # include <sys/types.h> 94148Seric # endif 104148Seric 114148Seric /* support for bool type */ 124148Seric typedef char bool; 13164Seric # define TRUE 1 14164Seric # define FALSE 0 15164Seric 16164Seric # ifndef NULL 17164Seric # define NULL 0 18164Seric # endif NULL 192975Seric 204148Seric /* bit hacking */ 212975Seric # define bitset(bit, word) ((word) & (bit)) 224086Seric 235196Seric /* assertions */ 245196Seric # ifndef NASSERT 255196Seric # define ASSERT(expr, msg, parm)\ 265196Seric if (!(expr))\ 275196Seric {\ 285196Seric fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\ 295196Seric fprintf(stderr, msg, parm);\ 305196Seric } 315196Seric # else NASSERT 325196Seric # define ASSERT(expr, msg, parm) 335196Seric # endif NASSERT 345196Seric 355196Seric /* sccs id's */ 365196Seric # ifndef lint 375196Seric # define SCCSID(arg) static char SccsId[] = "arg"; 385196Seric # else lint 395196Seric # define SCCSID(arg) 405196Seric # endif lint 415196Seric 424086Seric /* define the types of some common functions */ 435183Seric extern char *strcpy(), *strncpy(); 445183Seric extern char *strcat(), *strncat(); 454086Seric extern char *malloc(); 464086Seric extern char *index(), *rindex(); 474086Seric extern int errno; 484086Seric extern char *sprintf(); 494835Seric extern time_t time(); 504086Seric extern char *ctime(); 514086Seric # ifndef V6 524086Seric extern char *getenv(); 53*6281Seric # endif V6 54*6281Seric # ifndef VMUNIX 554438Seric typedef char *u_short; 564438Seric typedef long u_long; 574438Seric typedef char u_char; 584438Seric typedef int void; 59*6281Seric # endif VMUNIX 60