home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 319_01 / cpp.h < prev    next >
C/C++ Source or Header  |  1990-06-18  |  2KB  |  97 lines

  1. /*
  2.     CPP V5 -- Main header file.
  3.  
  4.     Source:  cpp.h
  5.     Started: September 26, 1987
  6.     Version: May 31, 1988; July 21, 1988
  7.  
  8.     Written by Edward K. Ream.
  9.     This software is in the public domain.
  10.  
  11.     See the read.me file for disclaimer and other information.
  12. */
  13.  
  14. /*
  15.     Define which compiler will be used to compile the program.
  16.     Typically, a command line option will be used to define these 
  17.     constants.
  18.  
  19.     TURBOC        use Turbo C compiler.
  20.     MICRO_SOFT    use version 4.0 of MicroSoft compiler on MS DOS.
  21. */
  22.  
  23. /*
  24.     Compile-time options:
  25.  
  26.     DEBUG        Make run-time checks.
  27.     STD_DIR        Name of first standard directory.
  28. */
  29.  
  30. #define DEBUG 1
  31.  
  32. /*
  33.     Define possible values for ch.
  34. */
  35. #define END_FILE 0x1a
  36.  
  37. /*
  38.     Define flags which will be found in macro replacement texts.
  39.     These flags MUST NOT BE NEGATIVE, so as to fit in a proper char.
  40. */
  41. #define ARG_FLAG 1
  42. #define POUND_FLAG 2
  43. #define CONCAT_FLAG 3
  44. #define EORT 4
  45. #define EXPAND_OFF 5
  46. #define ARG_OFFSET '0'
  47.  
  48. /*
  49.     Miscellaneous global constants.
  50. */
  51. #define ZERO    (0)
  52. #define TRUE    (1)
  53. #define FALSE    (0)
  54. #define ERROR    (-1)
  55. #define BAD_EXIT 1
  56.  
  57. #define INT_DIGITS 20        /* used by utl.c and other routines */
  58. #define LONG_DIGITS 40        /* used by utl.c and other routines */
  59. typedef int    bool;
  60.  
  61. #ifdef MICRO_SOFT
  62. #define FAR far
  63. #else
  64. #define FAR
  65. #endif
  66.  
  67. /*
  68.     Include subsidiary header files.
  69.     SL.H MUST be included even if SHERLOCK.C is not linked in.
  70. */
  71. #include <stdio.h>
  72. #include <stdlib.h>
  73. #include <ctype.h>
  74. #include <string.h>
  75. #include <process.h>
  76.  
  77. #include <sl.h>
  78.  
  79. #include "enum.h"
  80. #include "glb.h"
  81. #include "tmp.h"
  82.  
  83. /*
  84.     ----------    PREPROCESSOR    ----------
  85. */
  86. #define ishex(c) (isdigit(c) || (c >= 'A' && (c <= 'F' || (c>='a' && c<='f')))
  87. #define isid1(c) (isalpha(c) || c == '_')
  88. #define isid2(c) (isalpha(c) || isdigit(c) || c == '_')
  89.  
  90. #ifndef max
  91. #define max(a,b) (((a) > (b)) ? (a) : (b))
  92. #endif
  93.  
  94. #define TRACETOK(name) TRACEPB(name, printf("(%s)\n", pr_tok()))
  95. #define TRACECH(name)  TRACEPB(name, printf("(ch: %s)\n", pr_ch(ch)))
  96. #define is(tok) (token == tok)
  97.