|
|
1.1 ! root 1: /* ! 2: ** USEFUL.H -- useful stuff. ! 3: ** ! 4: ** Version: ! 5: ** @(#)useful.h 8.6 2/8/85 ! 6: */ ! 7: ! 8: # ifndef TRUE ! 9: # define TRUE 1 /* logical one, true, yes, ok, etc.*/ ! 10: # define FALSE 0 /* logical zero, false, no, nop, etc. */ ! 11: ! 12: typedef char bool; /* the boolean type */ ! 13: # endif TRUE ! 14: ! 15: # ifndef NULL ! 16: # define NULL 0 /* the null pointer */ ! 17: # endif NULL ! 18: ! 19: # ifndef bitset ! 20: # define bitset(bit, word) ((bit) & (word)) ! 21: # define setbit(bit, word) word |= bit ! 22: # define clrbit(bit, word) word &= ~bit ! 23: # endif bitset ! 24: ! 25: # ifndef min ! 26: # define min(a, b) (((a) < (b))? (a): (b)) ! 27: # define max(a, b) (((a) > (b))? (a): (b)) ! 28: # endif min ! 29: ! 30: # ifndef RELINFO ! 31: /* macros for the HELP function */ ! 32: # define RELINFO 0 /* info about a relation */ ! 33: # define MANSEC 1 /* manual section */ ! 34: # define DELLIST 2 /* list of delimitors */ ! 35: # define RELIST 3 /* list of relations */ ! 36: # define ALLRELINFO 4 /* info about all relations */ ! 37: # define ALLDELLIST 5 /* list of all delimitors */ ! 38: # endif RELINFO ! 39: ! 40: /* The following are BNF grammar delimiter types used by parser/tree.c */ ! 41: # define ONE 0 ! 42: # define ZEROMORE 1 ! 43: # define LBRACKET '[' ! 44: # define RBRACKET ']' ! 45: # define LBRACE '{' ! 46: # define RBRACE '}' ! 47: ! 48: /* ! 49: ** Various manifest constants storage constants. ! 50: */ ! 51: # define MAXF4 2147483647.0 ! 52: # define MINF4 -2147483648.0 ! 53: ! 54: # define MAXI2 127 ! 55: # define MINI2 -128 ! 56: ! 57: # define MAXI4 32767 ! 58: # define MINI4 -32768 ! 59: ! 60: # define MAXI8 2147483647 ! 61: # define MINI8 -2147483648 ! 62: ! 63: ! 64: # define I1MASK 0377 /* mask out sign extension that occurs ! 65: ** when a c1 or i1 field is converted ! 66: ** to an i2 field. ! 67: */ ! 68: ! 69: # include <fcntl.h> /* for O_* */ ! 70: ! 71: /* modes for dest_const in dbu/rmqm.c */ ! 72: # define DESTPROT 5 /* destroy permission */ ! 73: # define DESTINTEG 6 /* destroy integrity constraint */ ! 74: ! 75: /* modes for the return values of replace() in iutil/replace.c */ ! 76: # define NEWTUP 0 ! 77: # define DUPTUP 1 /* new tuple duplicate of returned tid*/ ! 78: # define DELTUP 2 /* tuple identified by tid deleted */ ! 79: # define BADLID 3 ! 80: ! 81: /* macro for gutil/cat.c */ ! 82: # define BLOCK_SZ 512 ! 83: ! 84: /* macros for return codes of initucode and initdbpath */ ! 85: # define NODB 1 ! 86: # define NOACCESS 2 ! 87: # define INVALIDUSR 3 ! 88: # define NODBNAME 4 ! 89: # define INDIRECT 5 ! 90: # define INDNODB 6 ! 91: ! 92: # define DBEXIST 0 ! 93: # define PTR2DB 1 ! 94: # define NODBS 2 ! 95: # define PTR2NODBS 3 ! 96: ! 97: /* macros for bitmap in dbu/pr_prot.c */ ! 98: # define BITMAP_SZ 8 ! 99: # define NUMSHIFTS 16 ! 100: ! 101: /* macros for conversion routines in gutil */ ! 102: # define CONCAT_BUFSZ 101 /* buffer for string concats */ ! 103: # define LONG_BUFSZ 30 /* buffer for long conversion*/ ! 104: # define CHAR_SZ 7 /* buffer for int to ascii conversion */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.