-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobals.h
92 lines (64 loc) · 2.58 KB
/
globals.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* ###############################################################
##
## C Tree Builder
##
## File: globals.h
##
## Programmer: Shawn Flisakowski
## Date: Dec 16, 1994
##
##
############################################################### */
#ifndef GLOBALS_H
#define GLOBALS_H
#include <stdio.h>
#include <string.h>
#include "config.h"
/* ############################################################### */
BEGIN_HEADER
#ifdef DEFINE_GLOBALS
#define EXT_DEF
#define EXT_INIT(VarDef,Init) VarDef = Init
#else
#define EXT_DEF extern
#define EXT_INIT(VarDef,Init) extern VarDef
#endif
/* ############################################################### */
#define MAX_FILES 256
/* ############################################################### */
#include "ctree.h"
#include "heap.h"
#include "treestk.h"
/* ############################################################### */
/* Flags */
EXT_INIT(int all, 0); /* Check for all errors (set of flags) */
EXT_INIT(int align, 0); /* Check for alignment independance */
EXT_INIT(int bounds, 1); /* Do array bounds checking */
EXT_INIT(int help, 0); /* Show ctree options */
EXT_INIT(int leak, 1); /* Watch for memory leaks */
EXT_INIT(int modify, 0); /* Allow self-modifying code */
EXT_INIT(int relax, 0); /* Relax errors somewhat (set of flags) */
EXT_INIT(int prompt, 1); /* Show a prompt (interactive) */
EXT_INIT(int warn, 1); /* Warnings for questionable things */
EXT_INIT(int version, 0); /* Show version */
EXT_INIT(int verbose, 1); /* Be very verbose */
EXT_INIT(char *inputf, NULL); /* The input file to use */
EXT_INIT(char *output, NULL); /* The output file */
EXT_INIT(char *dribble, NULL); /* A "dribble" file for the whole session */
EXT_INIT(char *emulate, NULL); /* A processor/compiler to emulate */
/* ############################################################### */
/* A level of indirection for input/output */
EXT_DEF FILE *infp;
EXT_DEF FILE *outfp;
EXT_DEF FILE *dupfp; /* For dribble output */
/* ############################################################### */
/* To hold the files/directories requested at startup */
EXT_DEF char *file_list[MAX_FILES];
/* The stack and top of the stack */
EXT_INIT(TreeStack *ParseStack, NULL);
EXT_INIT(Stk_Item *Parse_TOS, NULL);
/* Parse trees for included files are put here */
EXT_INIT(TreeStack *DoneStack, NULL);
END_HEADER
/* ############################################################### */
#endif /* GLOBALS_H */