File: sdcpp.h

package info (click to toggle)
sdcc 4.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 100,120 kB
  • sloc: ansic: 935,524; cpp: 75,055; makefile: 57,615; sh: 30,106; asm: 14,243; perl: 12,136; yacc: 7,297; lisp: 1,672; python: 815; lex: 781; awk: 498; sed: 89
file content (258 lines) | stat: -rw-r--r-- 7,065 bytes parent folder | download | duplicates (6)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
#ifndef __SDCPP_H
#define __SDCPP_H

#ifdef _WIN32
/* declaration of alloca */
#include <malloc.h>
#include <string.h>
#ifdef __BORLANDC__
#define strcasecmp  stricmp
#else
#define strcasecmp  _stricmp
#endif
#endif
#define BYTES_BIG_ENDIAN  0

/*
 * From defaults.h
 */
#ifndef GET_ENVIRONMENT
#define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
#endif

/* Define results of standard character escape sequences.  */
#define TARGET_BELL     007
#define TARGET_BS       010
#define TARGET_TAB      011
#define TARGET_NEWLINE  012
#define TARGET_VT       013
#define TARGET_FF       014
#define TARGET_CR       015
#define TARGET_ESC      033

#define CHAR_TYPE_SIZE 8
#define WCHAR_TYPE_SIZE 32      /* ? maybe ? */

#define SUPPORTS_ONE_ONLY 0

#define TARGET_OBJECT_SUFFIX ".rel"

#ifndef WCHAR_UNSIGNED
#define WCHAR_UNSIGNED 0
#endif

/*
 * From langhooks.h
 */
struct diagnostic_context;

struct lang_hooks
{
  /* The first callback made to the front end, for simple
     initialization needed before any calls to handle_option.  Return
     the language mask to filter the switch array with.  */
  unsigned int (*init_options) (unsigned int argc, const char **argv);

  /* Handle the switch CODE, which has real type enum opt_code from
     options.h.  If the switch takes an argument, it is passed in ARG
     which points to permanent storage.  The handler is responsible for
     checking whether ARG is NULL, which indicates that no argument
     was in fact supplied.  For -f and -W switches, VALUE is 1 or 0
     for the positive and negative forms respectively.

     Return 1 if the switch is valid, 0 if invalid, and -1 if it's
     valid and should not be treated as language-independent too.  */
  int (*handle_option) (size_t code, const char *arg, int value);

  /* Return false to use the default complaint about a missing
     argument, otherwise output a complaint and return true.  */
  bool (*missing_argument) (const char *opt, size_t code);

  /* Called when all command line options have been parsed to allow
     further processing and initialization

     Should return true to indicate that a compiler back-end is
     not required, such as with the -E option.

     If errorcount is nonzero after this call the compiler exits
     immediately and the finish hook is not called.  */
  bool (*post_options) (const char **);

  /* Called after post_options to initialize the front end.  Return
     false to indicate that no further compilation be performed, in
     which case the finish hook is called immediately.  */
  bool (*init) (void);

  /* Called at the end of compilation, as a finalizer.  */
  void (*finish) (void);
};

/* Each front end provides its own.  */
extern const struct lang_hooks lang_hooks;

/*
 * From toplev.h
 */
/* If we haven't already defined a frontend specific diagnostics
   style, use the generic one.  */
#ifndef GCC_DIAG_STYLE
#define GCC_DIAG_STYLE __gcc_tdiag__
#endif

extern void internal_error (const char *, ...) ATTRIBUTE_PRINTF_1
     ATTRIBUTE_NORETURN;
/* Pass one of the OPT_W* from options.h as the first parameter.  */
extern void warning (int, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void fatal_error (const char *, ...) ATTRIBUTE_PRINTF_1
     ATTRIBUTE_NORETURN;
extern void inform (const char *, ...) ATTRIBUTE_PRINTF_1;

extern const char *progname;
extern bool exit_after_options;

extern void print_version (FILE *, const char *);

/* Handle -d switch.  */
extern void decode_d_option (const char *);

/* Functions used to get and set GCC's notion of in what directory
   compilation was started.  */

extern const char *get_src_pwd (void);
extern bool set_src_pwd (const char *);

/*
 * From flags.h
 */
/* Don't suppress warnings from system headers.  -Wsystem-headers.  */

extern bool warn_system_headers;

/* If -Werror.  */

extern bool warnings_are_errors;

/* Nonzero for -pedantic switch: warn about anything
   that standard C forbids.  */

/* Temporarily suppress certain warnings.
   This is set while reading code from a system header file.  */

extern int in_system_header;

/* Nonzero means `char' should be signed.  */

extern int flag_signed_char;

/* Nonzero means change certain warnings into errors.
   Usually these are warnings about failure to conform to some standard.  */

extern int flag_pedantic_errors;

/*
 * From options.h
 */
extern int inhibit_warnings;

/*
 * From c-common.h
 */
#include "hwint.h"
#include "cpplib.h"

/* Nonzero means don't output line number information.  */

extern char flag_no_line_commands;

/* Nonzero causes -E output not to be done, but directives such as
   #define that have side effects are still obeyed.  */

extern char flag_no_output;

/* Nonzero means dump macros in some fashion; contains the 'D', 'M' or
   'N' of the command line switch.  */

extern char flag_dump_macros;

/* 0 means we want the preprocessor to not emit line directives for
   the current working directory.  1 means we want it to do it.  -1
   means we should decide depending on whether debugging information
   is being emitted or not.  */

extern int flag_working_directory;

/* Nonzero means warn about usage of long long when `-pedantic'.  */

extern int warn_long_long;

extern int sdcpp_common_handle_option (size_t code, const char *arg, int value);
extern bool sdcpp_common_missing_argument (const char *opt, size_t code);
extern unsigned int sdcpp_common_init_options (unsigned int, const char **);
extern bool sdcpp_common_post_options (const char **);
extern bool sdcpp_common_init (void);
extern void sdcpp_common_finish (void);

/* Nonzero means pass #include lines through to the output.  */

extern char flag_dump_includes;

/* In c-ppoutput.c  */
extern void init_pp_output (FILE *);
extern void preprocess_file (cpp_reader *);
extern void pp_file_change (const struct line_map *);
extern void pp_dir_change (cpp_reader *, const char *);

/*
 * From c-pragma.h
 */
extern struct cpp_reader* parse_in;

/*
 * From input.h
 */
extern struct line_maps *line_table;

typedef source_location location_t; /* deprecated typedef */

/* Top-level source file.  */
extern const char *main_input_filename;

/*
 * From tree.h
 */
/* Define the overall contents of a tree node.
   just to make diagnostic.c happy  */

union tree_node
{
  struct tree_decl
  {
    location_t locus;
  } decl;
};

#define DECL_SOURCE_LOCATION(NODE) ((NODE)->decl.locus)

/*
 * From diagnostic.h
 */
extern int errorcount;

/*
 * From c-tree.h
 */
/* In order for the format checking to accept the C frontend
   diagnostic framework extensions, you must include this file before
   toplev.h, not after.  */
#if GCC_VERSION >= 4001
#define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
#else
#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif

extern bool c_cpp_error (cpp_reader *, int, int, location_t, unsigned int,
			 const char *, va_list *)
     ATTRIBUTE_GCC_CDIAG(6,0);

#endif  /* __SDCPP_H */