2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
#ifndef OPTION_INCLUDED
|
|
|
32 |
#define OPTION_INCLUDED
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
/*
|
|
|
36 |
OPTION CATALOGUES
|
|
|
37 |
|
|
|
38 |
The table OPT_CATALOG is used to maintain the list of all boolean
|
|
|
39 |
options. The table OPT_VALUE_CATALOG is used to hold the value
|
|
|
40 |
options. Macros are given to name the entries in the latter table.
|
|
|
41 |
Names for entries in the former table are generated from the
|
|
|
42 |
error catalogue.
|
|
|
43 |
*/
|
|
|
44 |
|
|
|
45 |
typedef struct {
|
|
|
46 |
CONST char *name ;
|
|
|
47 |
int scoped ;
|
|
|
48 |
OPTION def [2] ;
|
|
|
49 |
} OPT_DATA ;
|
|
|
50 |
|
|
|
51 |
typedef struct {
|
|
|
52 |
CONST char *name ;
|
|
|
53 |
LOCATION *loc ;
|
|
|
54 |
unsigned long max_value ;
|
|
|
55 |
unsigned long min_value ;
|
|
|
56 |
unsigned long crt_value ;
|
|
|
57 |
int incr ;
|
|
|
58 |
} OPT_VALUE_DATA ;
|
|
|
59 |
|
|
|
60 |
extern OPT_DATA OPT_CATALOG [] ;
|
|
|
61 |
extern OPT_VALUE_DATA OPT_VALUE_CATALOG [] ;
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
/*
|
|
|
65 |
OPTION LEVELS
|
|
|
66 |
|
|
|
67 |
These values give the various option levels. The fact that OPTION_OFF
|
|
|
68 |
is zero is used extensively.
|
|
|
69 |
*/
|
|
|
70 |
|
|
|
71 |
#define OPTION_OFF ( ( OPTION ) 0 )
|
|
|
72 |
#define OPTION_WARN ( ( OPTION ) 1 )
|
|
|
73 |
#define OPTION_ON ( ( OPTION ) 2 )
|
|
|
74 |
#define OPTION_WHATEVER ( ( OPTION ) 3 )
|
|
|
75 |
|
|
|
76 |
#define OPTION_ALLOW OPTION_OFF
|
|
|
77 |
#define OPTION_DISALLOW OPTION_ON
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
/*
|
|
|
81 |
OPTION VALUES
|
|
|
82 |
|
|
|
83 |
These macros are used to represent the various numeric option values
|
|
|
84 |
within the program.
|
|
|
85 |
*/
|
|
|
86 |
|
|
|
87 |
#define OPT_VAL_statement_depth 0
|
|
|
88 |
#define OPT_VAL_hash_if_depth 1
|
|
|
89 |
#define OPT_VAL_declarator_max 2
|
|
|
90 |
#define OPT_VAL_paren_depth 3
|
|
|
91 |
#define OPT_VAL_name_limit 4
|
|
|
92 |
#define OPT_VAL_extern_name_limit 5
|
|
|
93 |
#define OPT_VAL_external_ids 6
|
|
|
94 |
#define OPT_VAL_block_ids 7
|
|
|
95 |
#define OPT_VAL_macro_ids 8
|
|
|
96 |
#define OPT_VAL_func_pars 9
|
|
|
97 |
#define OPT_VAL_func_args 10
|
|
|
98 |
#define OPT_VAL_macro_pars 11
|
|
|
99 |
#define OPT_VAL_macro_args 12
|
|
|
100 |
#define OPT_VAL_line_length 13
|
|
|
101 |
#define OPT_VAL_string_length 14
|
|
|
102 |
#define OPT_VAL_sizeof_object 15
|
|
|
103 |
#define OPT_VAL_include_depth 16
|
|
|
104 |
#define OPT_VAL_switch_cases 17
|
|
|
105 |
#define OPT_VAL_data_members 18
|
|
|
106 |
#define OPT_VAL_enum_consts 19
|
|
|
107 |
#define OPT_VAL_nested_class 20
|
|
|
108 |
#define OPT_VAL_atexit_funcs 21
|
|
|
109 |
#define OPT_VAL_base_classes 22
|
|
|
110 |
#define OPT_VAL_direct_bases 23
|
|
|
111 |
#define OPT_VAL_class_members 24
|
|
|
112 |
#define OPT_VAL_virtual_funcs 25
|
|
|
113 |
#define OPT_VAL_virtual_bases 26
|
|
|
114 |
#define OPT_VAL_static_members 27
|
|
|
115 |
#define OPT_VAL_friends 28
|
|
|
116 |
#define OPT_VAL_access_declarations 29
|
|
|
117 |
#define OPT_VAL_ctor_initializers 30
|
|
|
118 |
#define OPT_VAL_scope_qualifiers 31
|
|
|
119 |
#define OPT_VAL_external_specs 32
|
|
|
120 |
#define OPT_VAL_template_pars 33
|
|
|
121 |
#define OPT_VAL_instance_depth 34
|
|
|
122 |
#define OPT_VAL_exception_handlers 35
|
|
|
123 |
#define OPT_VAL_exception_specs 36
|
|
|
124 |
#define OPT_VAL_cast_explicit 37
|
|
|
125 |
#define OPT_VAL_maximum_error 38
|
|
|
126 |
#define OPT_VAL_tab_width 39
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
/*
|
|
|
130 |
COMPILER OPTION DECLARATIONS
|
|
|
131 |
|
|
|
132 |
The routines in this module are concerned with configurable compiler
|
|
|
133 |
options.
|
|
|
134 |
*/
|
|
|
135 |
|
|
|
136 |
extern OPTION *crt_opt ;
|
|
|
137 |
extern OPTIONS *crt_opts ;
|
|
|
138 |
extern OPTIONS *real_opts ;
|
|
|
139 |
extern void set_option PROTO_S ( ( int, unsigned ) ) ;
|
|
|
140 |
extern void set_value PROTO_S ( ( int, EXP, unsigned long ) ) ;
|
|
|
141 |
extern void set_link_opt PROTO_S ( ( DECL_SPEC ) ) ;
|
|
|
142 |
extern ERROR set_severity PROTO_S ( ( ERROR, int, int ) ) ;
|
|
|
143 |
extern int find_option_no PROTO_S ( ( STRING, int ) ) ;
|
|
|
144 |
extern int find_value_no PROTO_S ( ( STRING, int ) ) ;
|
|
|
145 |
extern int find_type_no PROTO_S ( ( STRING ) ) ;
|
|
|
146 |
extern int check_value PROTO_W ( ( int, unsigned long, ... ) ) ;
|
|
|
147 |
extern int incr_value PROTO_S ( ( int ) ) ;
|
|
|
148 |
extern void decr_value PROTO_S ( ( int ) ) ;
|
|
|
149 |
extern void use_option PROTO_S ( ( IDENTIFIER, unsigned ) ) ;
|
|
|
150 |
extern void use_mode PROTO_S ( ( OPTIONS *, int ) ) ;
|
|
|
151 |
extern void set_mode PROTO_S ( ( OPTIONS * ) ) ;
|
|
|
152 |
extern void directory_option PROTO_S ( ( IDENTIFIER, IDENTIFIER ) ) ;
|
|
|
153 |
extern void begin_option PROTO_S ( ( IDENTIFIER ) ) ;
|
|
|
154 |
extern void end_option PROTO_S ( ( int ) ) ;
|
|
|
155 |
extern void init_option PROTO_S ( ( int ) ) ;
|
|
|
156 |
extern void term_option PROTO_S ( ( void ) ) ;
|
|
|
157 |
|
|
|
158 |
#define option( A ) ( crt_opt [ ( A ) ] )
|
|
|
159 |
#define option_value( A ) ( OPT_VALUE_CATALOG [ ( A ) ].max_value )
|
|
|
160 |
#define crt_option_value( A ) ( OPT_VALUE_CATALOG [ ( A ) ].crt_value )
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
#endif
|