Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2006 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 41... Line 71...
41
    Names for entries in the former table are generated from the
71
    Names for entries in the former table are generated from the
42
    error catalogue.
72
    error catalogue.
43
*/
73
*/
44
 
74
 
45
typedef struct {
75
typedef struct {
46
    CONST char *name ;
76
    CONST char *name;
47
    int scoped ;
77
    int scoped;
48
    OPTION def [2] ;
78
    OPTION def[2];
49
} OPT_DATA ;
79
} OPT_DATA;
50
 
80
 
51
typedef struct {
81
typedef struct {
52
    CONST char *name ;
82
    CONST char *name;
53
    LOCATION *loc ;
83
    LOCATION *loc;
54
    unsigned long max_value ;
84
    unsigned long max_value;
55
    unsigned long min_value ;
85
    unsigned long min_value;
56
    unsigned long crt_value ;
86
    unsigned long crt_value;
57
    int incr ;
87
    int incr;
58
} OPT_VALUE_DATA ;
88
} OPT_VALUE_DATA;
59
 
89
 
60
extern OPT_DATA OPT_CATALOG [] ;
90
extern OPT_DATA OPT_CATALOG[];
61
extern OPT_VALUE_DATA OPT_VALUE_CATALOG [] ;
91
extern OPT_VALUE_DATA OPT_VALUE_CATALOG[];
62
 
92
 
63
 
93
 
64
/*
94
/*
65
    OPTION LEVELS
95
    OPTION LEVELS
66
 
96
 
67
    These values give the various option levels.  The fact that OPTION_OFF
97
    These values give the various option levels.  The fact that OPTION_OFF
68
    is zero is used extensively.
98
    is zero is used extensively.
69
*/
99
*/
70
 
100
 
71
#define OPTION_OFF				( ( OPTION ) 0 )
101
#define OPTION_OFF				((OPTION)0)
72
#define OPTION_WARN				( ( OPTION ) 1 )
102
#define OPTION_WARN				((OPTION)1)
73
#define OPTION_ON				( ( OPTION ) 2 )
103
#define OPTION_ON				((OPTION)2)
74
#define OPTION_WHATEVER				( ( OPTION ) 3 )
104
#define OPTION_WHATEVER				((OPTION)3)
75
 
105
 
76
#define OPTION_ALLOW				OPTION_OFF
106
#define OPTION_ALLOW				OPTION_OFF
77
#define OPTION_DISALLOW				OPTION_ON
107
#define OPTION_DISALLOW				OPTION_ON
78
 
108
 
79
 
109
 
Line 131... Line 161...
131
 
161
 
132
    The routines in this module are concerned with configurable compiler
162
    The routines in this module are concerned with configurable compiler
133
    options.
163
    options.
134
*/
164
*/
135
 
165
 
136
extern OPTION *crt_opt ;
166
extern OPTION *crt_opt;
137
extern OPTIONS *crt_opts ;
167
extern OPTIONS *crt_opts;
138
extern OPTIONS *real_opts ;
168
extern OPTIONS *real_opts;
139
extern void set_option PROTO_S ( ( int, unsigned ) ) ;
169
extern void set_option(int, unsigned);
140
extern void set_value PROTO_S ( ( int, EXP, unsigned long ) ) ;
170
extern void set_value(int, EXP, unsigned long);
141
extern void set_link_opt PROTO_S ( ( DECL_SPEC ) ) ;
171
extern void set_link_opt(DECL_SPEC);
142
extern ERROR set_severity PROTO_S ( ( ERROR, int, int ) ) ;
172
extern ERROR set_severity(ERROR, int, int);
143
extern int find_option_no PROTO_S ( ( STRING, int ) ) ;
173
extern int find_option_no(STRING, int);
144
extern int find_value_no PROTO_S ( ( STRING, int ) ) ;
174
extern int find_value_no(STRING, int);
145
extern int find_type_no PROTO_S ( ( STRING ) ) ;
175
extern int find_type_no(STRING);
146
extern int check_value PROTO_W ( ( int, unsigned long, ... ) ) ;
176
extern int check_value(int, unsigned long, ...);
147
extern int incr_value PROTO_S ( ( int ) ) ;
177
extern int incr_value(int);
148
extern void decr_value PROTO_S ( ( int ) ) ;
178
extern void decr_value(int);
149
extern void use_option PROTO_S ( ( IDENTIFIER, unsigned ) ) ;
179
extern void use_option(IDENTIFIER, unsigned);
150
extern void use_mode PROTO_S ( ( OPTIONS *, int ) ) ;
180
extern void use_mode(OPTIONS *, int);
151
extern void set_mode PROTO_S ( ( OPTIONS * ) ) ;
181
extern void set_mode(OPTIONS *);
152
extern void directory_option PROTO_S ( ( IDENTIFIER, IDENTIFIER ) ) ;
182
extern void directory_option(IDENTIFIER, IDENTIFIER);
153
extern void begin_option PROTO_S ( ( IDENTIFIER ) ) ;
183
extern void begin_option(IDENTIFIER);
154
extern void end_option PROTO_S ( ( int ) ) ;
184
extern void end_option(int);
155
extern void init_option PROTO_S ( ( int ) ) ;
185
extern void init_option(int);
156
extern void term_option PROTO_S ( ( void ) ) ;
186
extern void term_option(void);
157
 
187
 
158
#define option( A )		( crt_opt [ ( A ) ] )
188
#define option(A)		(crt_opt[(A)])
159
#define option_value( A )	( OPT_VALUE_CATALOG [ ( A ) ].max_value )
189
#define option_value(A)	(OPT_VALUE_CATALOG[(A)].max_value)
160
#define crt_option_value( A )	( OPT_VALUE_CATALOG [ ( A ) ].crt_value )
190
#define crt_option_value(A)	(OPT_VALUE_CATALOG[(A)].crt_value)
161
 
191
 
162
 
192
 
163
#endif
193
#endif