1164Seric /*
2164Seric **  USEFUL.H -- Some useful stuff.
3402Seric **
4*5196Seric **	@(#)useful.h	3.7		12/06/81
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 
23*5196Seric /* assertions */
24*5196Seric # ifndef NASSERT
25*5196Seric # define ASSERT(expr, msg, parm)\
26*5196Seric 	if (!(expr))\
27*5196Seric 	{\
28*5196Seric 		fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\
29*5196Seric 		fprintf(stderr, msg, parm);\
30*5196Seric 	}
31*5196Seric # else NASSERT
32*5196Seric # define ASSERT(expr, msg, parm)
33*5196Seric # endif NASSERT
34*5196Seric 
35*5196Seric /* sccs id's */
36*5196Seric # ifndef lint
37*5196Seric # define SCCSID(arg)	static char SccsId[] = "arg";
38*5196Seric # else lint
39*5196Seric # define SCCSID(arg)
40*5196Seric # endif lint
41*5196Seric 
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();
534438Seric # else V6
544438Seric typedef char	*u_short;
554438Seric typedef long	u_long;
564438Seric typedef char	u_char;
574438Seric typedef int	void;
584438Seric # endif V6
59