1: /*
   2: **  USEFUL.H -- Some useful stuff.
   3: **
   4: **	@(#)useful.h	4.1		7/25/83
   5: */
   6: 
   7: # ifndef makedev
   8: # include <sys/types.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: /* some simple functions */
  24: # ifndef max
  25: # define max(a, b)  ((a) > (b) ? (a) : (b))
  26: # define min(a, b)  ((a) < (b) ? (a) : (b))
  27: # endif max
  28: 
  29: /* assertions */
  30: # ifndef NASSERT
  31: # define ASSERT(expr, msg, parm)\
  32:     if (!(expr))\
  33:     {\
  34:         fprintf(stderr, "assertion botch: %s:%d: ", __FILE__, __LINE__);\
  35:         fprintf(stderr, msg, parm);\
  36:     }
  37: # else NASSERT
  38: # define ASSERT(expr, msg, parm)
  39: # endif NASSERT
  40: 
  41: /* sccs id's */
  42: # ifndef lint
  43: # define SCCSID(arg)    static char SccsId[] = "arg";
  44: # else lint
  45: # define SCCSID(arg)
  46: # endif lint
  47: 
  48: /* define the types of some common functions */
  49: extern char *strcpy(), *strncpy();
  50: extern char *strcat(), *strncat();
  51: extern char *malloc();
  52: extern char *index(), *rindex();
  53: extern int  errno;
  54: extern char *sprintf();
  55: extern time_t   time();
  56: extern char *ctime();
  57: # ifndef V6
  58: extern char *getenv();
  59: # endif V6
  60: # ifndef VMUNIX
  61: typedef unsigned short  u_short;
  62: typedef long        u_long;
  63: typedef char        u_char;
  64: typedef int     void;
  65: # endif VMUNIX

Defined typedef's

bool defined in line 12; never used
u_char defined in line 63; never used
u_long defined in line 62; never used
u_short defined in line 61; never used

Defined macros

ASSERT defined in line 38; never used
FALSE defined in line 14; never used
NULL defined in line 17; used 1 times
  • in line 16
SCCSID defined in line 45; never used
TRUE defined in line 13; never used
bitset defined in line 21; never used
max defined in line 25; used 1 times
  • in line 24
min defined in line 26; never used
Last modified: 1983-07-26
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1153
Valid CSS Valid XHTML 1.0 Strict