Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
263 dpurdie 1
/*
2
	CPP V5 -- global header for variables.
3
 
4
	Source:  glb.h
5
	Started: June 20, 1986
6
	Version: May 21, 1988; August 1, 1989
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
	Constants describing limits.
16
*/
17
#define MAX_SYMBOL	1000	/* Max len of symbols/strings.		*/
18
#define MAX_FILE_NAME	50	/* Maximum length of file names.	*/
19
#define MAX_IF		50	/* Max nesting level of #if's.		*/
20
#define MAX_PATHS	20	/* Max number of -s args.		*/
21
#define MAX_RTEXT	1000	/* Max chars in replacement string.	*/
22
#define MAX_ATEXT	1000	/* Max total chars in actual args.	*/
23
#define MAX_NARGS	50	/* Max number of macro arguments.	*/
24
#define MAX_MDEPTH	100	/* Max depth of macro expansions.	*/
25
#define MAX_INCLUDE	MAX_MDEPTH+20
26
 
27
/*
28
	Exclude the rest if glb.c is the file including this file.
29
*/
30
#ifndef no_extern
31
 
32
/*
33
	============= global variables =============
34
*/
35
 
36
/*
37
	The next character of input.
38
*/
39
extern char	ch;		/* The NEXT character.			*/
40
 
41
 
42
/*
43
	User Flags.
44
*/
45
extern bool	nest_flag;	/* TRUE = allow nested comments.	*/
46
extern bool	com_flag;	/* TRUE = leave comments in output.	*/
47
extern bool	slc_flag;	/* TRUE = allow single-line comments.	*/
48
 
49
/*
50
	Globals for macro expansion.
51
	p_rescan and m_flag are used by sysnext().
52
*/
53
extern bool	m_flag;			/* TRUE if expanding a macro.	*/
54
extern char	macro_buf[MAX_RTEXT];	/* Final macro buffer.		*/
55
extern char *	p_rescan;		/* Pointer into rescan_buf[].	*/
56
 
57
 
58
/*
59
	Globals describing tokens.
60
 
61
	The code assumes that no token or string will ever be longer than
62
	MAX_SYMBOL.  If that ever is not so the program may crash.  Thus,
63
	MAX_SYMBOL should be very large -- say 1000 or more.
64
*/
65
extern en_tokens token;			/* The current token. */
66
extern int	t_subtype;		/* The subtype of token class.		*/
67
extern char	t_symbol [MAX_SYMBOL];	/* The spelling of the token.		*/
68
extern int	t_length;		/* The length of the token (in the text)*/
69
extern long	t_value;		/* Value of integer constants.		*/
70
 
71
/*
72
	The following globals are set ONLY by the system module and
73
	used by the preprocessor.
74
*/
75
extern char *	t_file;			/* Name of current input file.	*/
76
extern int	t_line;			/* Line number within file.	*/
77
extern int	t_inlevel;		/* Current input file level.	*/
78
 
79
/*
80
	Globals for use internally to the token routines.
81
*/
82
extern bool	t_ifstack [MAX_IF];	/* Stack for nexted #if's	*/
83
extern int	t_iflevel;		/* Nexting depth of #if's	*/
84
extern long	t_errcount;		/* Number of errors seen.	*/
85
 
86
/*
87
	Defines for the path table.
88
	This table is used to search for #include files.
89
*/
90
extern char *	paths [MAX_PATHS];	/* Pointers to path names.	*/
91
extern int	n_paths;		/* Number of paths defined.	*/
92
 
93
#endif /* no_extern */