Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
263 dpurdie 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
#if (0)
30
#define DEBUG
31
#endif
32
 
33
/*
34
	Define possible values for ch.
35
*/
36
#define END_FILE 0x1a
37
 
38
/*
39
	Define flags which will be found in macro replacement texts.
40
	These flags MUST NOT BE NEGATIVE, so as to fit in a proper char.
41
*/
42
#define ARG_FLAG 1
43
#define POUND_FLAG 2
44
#define CONCAT_FLAG 3
45
#define EORT 4
46
#define EXPAND_OFF 5
47
#define ARG_OFFSET '0'
48
 
49
/*
50
	Miscellaneous global constants.
51
*/
52
#define ZERO	(0)
53
#define TRUE	(1)
54
#define FALSE	(0)
55
#define ERROR	(-1)
56
#define BAD_EXIT 1
57
 
58
#define INT_DIGITS 20		/* used by utl.c and other routines */
59
#define LONG_DIGITS 40		/* used by utl.c and other routines */
60
typedef int	bool;
61
 
62
#ifdef MICRO_SOFT
63
#define FAR far
64
#else
65
#define FAR
66
#endif
67
 
68
/*
69
	Include subsidiary header files.
70
	SL.H MUST be included even if SHERLOCK.C is not linked in.
71
*/
72
#include <stdio.h>
73
#include <stdlib.h>
74
#include <ctype.h>
75
#include <string.h>
76
#include <process.h>
77
 
78
#include <sl.h>
79
 
80
#include "enum.h"
81
#include "glb.h"
82
#include "tmp.h"
83
 
84
/*
85
	----------    PREPROCESSOR    ----------
86
*/
87
#define ishex(c) (isdigit(c) || (c >= 'A' && (c <= 'F' || (c>='a' && c<='f')))
88
#define isid1(c) (isalpha(c) || c == '_')
89
#define isid2(c) (isalpha(c) || isdigit(c) || c == '_')
90
 
91
#ifndef max
92
#define max(a,b) (((a) > (b)) ? (a) : (b))
93
#endif
94
 
95
#define TRACETOK(name) TRACEPB(name, printf("(%s)\n", pr_tok()))
96
#define TRACECH(name)  TRACEPB(name, printf("(ch: %s)\n", pr_ch(ch)))
97
#define is(tok) (token == tok)