|
|
1.1 ! root 1: /* This file contains standard definitions of useful C constants ! 2: * and macros. J. Leth, IH 6E-318 ! 3: */ ! 4: ! 5: ! 6: typedef int BOOLEAN; ! 7: ! 8: #define HIGHB 0xff00 ! 9: #define LOWB 0x00ff ! 10: ! 11: #define TRUE 1 ! 12: #define FALSE 0 ! 13: ! 14: #define NUL '\0' ! 15: ! 16: #define makeint(hi,lo) ((hi << 8) | (lo & LOWB)) ! 17: /* Makes an int out of two bytes */ ! 18: ! 19: #define usage(x) fprintf(stderr, x); exit(1) ! 20: #define errexit(x,arg) fprintf(stderr, x, arg); perror(""); exit(1) ! 21: #define errmsg(x,arg) fprintf(stderr, x, arg) ! 22: ! 23: #define IDENT(x)x ! 24: #define CONCAT(x,y)IDENT(x)y ! 25: /* Concatenates two symbols into one, (compiler or C ! 26: * preprocessor symbols). ! 27: */ ! 28: #define QUOTE(x)"x" ! 29: ! 30: #ifndef NDEBUG ! 31: # define assert(ex) if (!(ex)) {\ ! 32: fprintf(stderr,"Assertion '%s' failed: file %s, line %d\n",\ ! 33: QUOTE(ex), __FILE__, __LINE__);\ ! 34: exit(1);\ ! 35: } ! 36: #else ! 37: # define assert(ex) ! 38: #endif ! 39: ! 40: #define ESC '\033' ! 41: ! 42: #ifdef TRACEFLAG ! 43: #define TRACE(x,y) fprintf(stderr, "TRACE: "); fprintf(stderr, x, y) ! 44: #define TRACE2(x,y,z) fprintf(stderr, "TRACE: "); fprintf(stderr, x, y, z) ! 45: #else ! 46: #define TRACE(x,y) ! 47: #define TRACE2(x,y,z) ! 48: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.