home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume3 / proto / dcw.h next >
C/C++ Source or Header  |  1989-02-03  |  1KB  |  49 lines

  1. /*
  2.  *    My standard include file
  3.  *
  4.  ********* History:
  5.  *
  6.  *    Version    Who    Date        Comments
  7.  *    =======    ===    ====        ========
  8.  *    1.3.3    dcw    6th June 1988    Made BOOL & BOOLEAN char, not int!!
  9.  *    1.3.2    dcw    26th Apr 1988    Added NOC_ALLOC, NOC_NEW, made
  10.  *                    COPYOF call NOC_ALLOC !!!
  11.  *    1.3.1    dcw    2nd Mar 1988    Changed name to dcw.h and dcwos.h
  12.  *                    included strings.h and ctype.h
  13.  *                    added extern calloc() decln
  14.  *    1.3    dcw    9th Sep 1987    Included os.h
  15.  *    1.2    dcw    19th July 1987    Made external 'extern' [was null]
  16.  *                    and added brackets in streq
  17.  *    1.1    dcw    2nd July 1987    Added BOOLEAN as well as BOOL !
  18.  *    1.0    dcw    10th June 1987    Wrote it.
  19.  */
  20.  
  21.  
  22. #include <stdio.h>
  23. #include <strings.h>
  24. #include <ctype.h>
  25. #include "dcwos.h"
  26.  
  27. extern char *calloc(), malloc();
  28.  
  29. #define ASSERT(x,y) if(!(x)){printf y;exit(1);}
  30. #define ABORT(y)    ASSERT(FALSE,y)
  31. #define FORWARD
  32. #define EXTERNAL    extern
  33.  
  34. #define ALLOC(n,t) (t *)calloc((n),sizeof(t))
  35. #define NEW(t)     ALLOC(1,t)
  36.  
  37. /* make copy of old string into new: was ALLOC not NOC_ALLOC */
  38. #define COPYOF(new,old)  {new=NOC_ALLOC(1+strlen(old),char);strcpy(new,old);}
  39.  
  40. #define NOC_ALLOC(n,t) (t *)malloc((n)*sizeof(t))
  41. #define NOC_NEW(t)     NOC_ALLOC(1,t)
  42.  
  43. #define streq(x,y)  (strcmp((x),(y))==0)
  44.  
  45. #define BOOL    char
  46. #define BOOLEAN char
  47. #define TRUE    1
  48. #define FALSE   0
  49.