chiark / gitweb /
Imported Upstream version 1.0.0
[e16] / epp / cpplib.h
1
2 /* Definitions for CPP library.
3    Copyright (C) 1995 Free Software Foundation, Inc.
4    Written by Per Bothner, 1994-95.
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20  In other words, you are welcome to use, share and improve this program.
21  You are forbidden to forbid anyone else to use, share and improve
22  what you give them.   Help stamp out software-hoarding!  */
23
24 #include <stdarg.h>
25 #include <sys/types.h>
26 #include <sys/stat.h>
27
28 #ifndef HOST_BITS_PER_WIDE_INT
29
30 #if HOST_BITS_PER_LONG > HOST_BITS_PER_INT
31 #define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
32 #define HOST_WIDE_INT long
33 #else
34 #define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
35 #define HOST_WIDE_INT int
36 #endif
37
38 #endif
39
40 #define STATIC_BUFFERS
41
42 typedef struct cpp_reader cpp_reader;
43 typedef struct cpp_buffer cpp_buffer;
44 typedef struct cpp_options cpp_options;
45
46 enum cpp_token {
47    CPP_EOF = -1,
48    CPP_OTHER = 0,
49    CPP_COMMENT = 1,
50    CPP_HSPACE,
51    CPP_VSPACE,                  /* newlines and #line directives */
52    CPP_NAME,
53    CPP_NUMBER,
54    CPP_CHAR,
55    CPP_STRING,
56    CPP_DIRECTIVE,
57    CPP_LPAREN,                  /* "(" */
58    CPP_RPAREN,                  /* ")" */
59    CPP_LBRACE,                  /* "{" */
60    CPP_RBRACE,                  /* "}" */
61    CPP_COMMA,                   /* "," */
62    CPP_SEMICOLON,               /* ";" */
63    CPP_3DOTS,                   /* "..." */
64    /* POP_TOKEN is returned when we've popped a cpp_buffer. */
65    CPP_POP
66 };
67
68 typedef enum cpp_token (*parse_underflow_t) (cpp_reader *);
69 typedef int         (*parse_cleanup_t) (cpp_buffer *, cpp_reader *);
70
71 /* A parse_marker indicates a previous position,
72    which we can backtrack to. */
73
74 struct parse_marker {
75    cpp_buffer         *buf;
76    struct parse_marker *next;
77    int                 position;
78 };
79
80 extern int          cpp_handle_options(cpp_reader * pfile, int, char **);
81 extern enum cpp_token cpp_get_token(cpp_reader * pfile);
82 extern void         cpp_skip_hspace(cpp_reader * pfile);
83
84 /* Maintain and search list of included files, for #import.  */
85
86 #define IMPORT_HASH_SIZE 31
87
88 struct import_file {
89    char               *name;
90    ino_t               inode;
91    dev_t               dev;
92    struct import_file *next;
93 };
94
95 /* If we have a huge buffer, may need to cache more recent counts */
96 #define CPP_LINE_BASE(BUF) ((BUF)->buf + (BUF)->line_base)
97
98 enum dump_type {
99    dump_none = 0, dump_only, dump_names, dump_definitions
100 };
101
102 struct cpp_buffer {
103    unsigned char      *buf;
104    unsigned char      *cur;
105    unsigned char      *rlimit;  /* end of valid data */
106    unsigned char      *alimit;  /* end of allocated buffer */
107    unsigned char      *prev;    /* start of current token */
108
109    const char         *fname;
110    /* Filename specified with #line command.  */
111    const char         *nominal_fname;
112
113    /* Record where in the search path this file was found.
114     * For #include_next.  */
115    struct file_name_list *dir;
116
117    long                line_base;
118    long                lineno;  /* Line number at CPP_LINE_BASE. */
119    long                colno;   /* Column number at CPP_LINE_BASE. */
120 #ifndef STATIC_BUFFERS
121    cpp_buffer         *chain;
122 #endif
123    parse_underflow_t   underflow;
124    parse_cleanup_t     cleanup;
125    void               *data;
126    struct parse_marker *marks;
127    /* Value of if_stack at start of this file.
128     * Used to prohibit unmatched #endif (etc) in an include file.  */
129    struct if_stack    *if_stack;
130
131    /* True if this is a header file included using <FILENAME>.  */
132    char                system_header_p;
133    char                seen_eof;
134
135    /* True if buffer contains escape sequences.
136     * Currently there are are only two kind:
137     * "@-" means following identifier should not be macro-expanded.
138     * "@ " means a token-separator.  This turns into " " in final output
139     * if not stringizing and needed to separate tokens; otherwise nothing.
140     * "@@" means a normal '@'.
141     * (An '@' inside a string stands for itself and is never an escape.) */
142    char                has_escapes;
143 };
144
145 struct cpp_pending;             /* Forward declaration - for C++. */
146 struct file_name_map_list;
147
148 typedef struct assertion_hashnode ASSERTION_HASHNODE;
149
150 #define ASSERTION_HASHSIZE 37
151
152 #ifdef STATIC_BUFFERS
153 /* Maximum nesting of cpp_buffers.  We use a static limit, partly for
154    efficiency, and partly to limit runaway recursion.  */
155 #define CPP_STACK_MAX 200
156 #endif
157
158 struct cpp_reader {
159    unsigned char      *limit;
160    parse_underflow_t   get_token;
161    cpp_buffer         *buffer;
162 #ifdef STATIC_BUFFERS
163    cpp_buffer          buffer_stack[CPP_STACK_MAX];
164 #endif
165
166    int                 errors;  /* Error counter for exit code */
167    void               *data;
168
169    unsigned char      *token_buffer;
170    int                 token_buffer_size;
171
172    /* Line where a newline was first seen in a string constant.  */
173    int                 multiline_string_line;
174
175    /* Current depth in #include directives that use <...>.  */
176    int                 system_include_depth;
177
178    /* List of included files that contained #pragma once.  */
179    struct file_name_list *dont_repeat_files;
180
181    /* List of other included files.
182     * If ->control_macro if nonzero, the file had a #ifndef
183     * around the entire contents, and ->control_macro gives the macro name.  */
184    struct file_name_list *all_include_files;
185
186    /* Current maximum length of directory names in the search path
187     * for include files.  (Altered as we get more of them.)  */
188    int                 max_include_len;
189
190    /* Hash table of files already included with #include or #import.  */
191    struct import_file *import_hash_table[IMPORT_HASH_SIZE];
192
193    struct if_stack    *if_stack;
194
195    /* Nonzero means we are inside an IF during a -pcp run.  In this mode
196     * macro expansion is done, and preconditions are output for all macro
197     * uses requiring them. */
198    char                pcp_inside_if;
199
200    /* Nonzero means we have printed (while error reporting) a list of
201     * containing files that matches the current status. */
202    char                input_stack_listing_current;
203
204    /* If non-zero, macros are not expanded. */
205    char                no_macro_expand;
206
207    /* Print column number in error messages. */
208    char                show_column;
209
210    /* We're printed a warning recommending against using #import. */
211    char                import_warning;
212
213    /* If true, character between '<' and '>' are a single (string) token. */
214    char                parsing_include_directive;
215
216    /* True if escape sequences (as described for has_escapes in
217     * parse_buffer) should be emitted. */
218    char                output_escapes;
219
220    /* 0: Have seen non-white-space on this line.
221     * 1: Only seen white space so far on this line.
222     * 2: Only seen white space so far in this file. */
223    char                only_seen_white;
224
225    /* Nonzero means this file was included with a -imacros or -include
226     * command line and should not be recorded as an include file.  */
227
228    int                 no_record_file;
229
230    long                lineno;
231
232    struct tm          *timebuf;
233
234    ASSERTION_HASHNODE *assertion_hashtab[ASSERTION_HASHSIZE];
235
236    /* Buffer of -M output.  */
237    char               *deps_buffer;
238
239    /* Number of bytes allocated in above.  */
240    int                 deps_allocated_size;
241
242    /* Number of bytes used.  */
243    int                 deps_size;
244
245    /* Number of bytes since the last newline.  */
246    int                 deps_column;
247 };
248
249 #define CPP_BUF_PEEK(BUFFER) \
250   ((BUFFER)->cur < (BUFFER)->rlimit ? *(BUFFER)->cur : EOF)
251 #define CPP_BUF_GET(BUFFER) \
252   ((BUFFER)->cur < (BUFFER)->rlimit ? *(BUFFER)->cur++ : EOF)
253 #define CPP_FORWARD(BUFFER, N) ((BUFFER)->cur += (N))
254
255 /* Number of characters currently in PFILE's output buffer. */
256 #define CPP_WRITTEN(PFILE) ((PFILE)->limit - (PFILE)->token_buffer)
257 #define CPP_PWRITTEN(PFILE) ((PFILE)->limit)
258
259 /* Make sure PFILE->token_buffer has space for at least N more characters. */
260 #define CPP_RESERVE(PFILE, N) \
261   ((unsigned int)(CPP_WRITTEN (PFILE) + N) > (unsigned int) (PFILE)->token_buffer_size \
262    && (cpp_grow_buffer (PFILE, N), 0))
263
264 /* Append string STR (of length N) to PFILE's output buffer.
265    Assume there is enough space. */
266 #define CPP_PUTS_Q(PFILE, STR, N) \
267   (memcpy ((PFILE)->limit, STR, (N)), (PFILE)->limit += (N))
268 /* Append string STR (of length N) to PFILE's output buffer.  Make space. */
269 #define CPP_PUTS(PFILE, STR, N) CPP_RESERVE(PFILE, N), CPP_PUTS_Q(PFILE, STR,N)
270 /* Append character CH to PFILE's output buffer.  Assume sufficient space. */
271 #define CPP_PUTC_Q(PFILE, CH) (*(PFILE)->limit++ = (CH))
272 /* Append character CH to PFILE's output buffer.  Make space if need be. */
273 #define CPP_PUTC(PFILE, CH) (CPP_RESERVE (PFILE, 1), CPP_PUTC_Q (PFILE, CH))
274 /* Make sure PFILE->limit is followed by '\0'. */
275 #define CPP_NUL_TERMINATE_Q(PFILE) (*(PFILE)->limit = 0)
276 #define CPP_NUL_TERMINATE(PFILE) (CPP_RESERVE(PFILE, 1), *(PFILE)->limit = 0)
277 #define CPP_ADJUST_WRITTEN(PFILE,DELTA) ((PFILE)->limit += (DELTA))
278 #define CPP_SET_WRITTEN(PFILE,N) ((PFILE)->limit = (PFILE)->token_buffer + (N))
279
280 #define CPP_OPTIONS(PFILE) ((cpp_options*)(PFILE)->data)
281 #define CPP_BUFFER(PFILE) ((PFILE)->buffer)
282 #ifdef STATIC_BUFFERS
283 #define CPP_PREV_BUFFER(BUFFER) ((BUFFER)+1)
284 #define CPP_NULL_BUFFER(PFILE) (&(PFILE)->buffer_stack[CPP_STACK_MAX])
285 #else
286 #define CPP_PREV_BUFFER(BUFFER) ((BUFFER)->chain)
287 #define CPP_NULL_BUFFER(PFILE) ((cpp_buffer*)0)
288 #endif
289
290 /* Pointed to by parse_file::data. */
291 struct cpp_options {
292    const char         *in_fname;
293
294    /* Name of output file, for error messages.  */
295    const char         *out_fname;
296
297    struct file_name_map_list *map_list;
298
299    /* Non-0 means -v, so print the full set of include dirs.  */
300    char                verbose;
301
302    /* Nonzero means use extra default include directories for C++.  */
303
304    char                cplusplus;
305
306    /* Nonzero means handle cplusplus style comments */
307
308    char                cplusplus_comments;
309
310    /* Nonzero means handle #import, for objective C.  */
311
312    char                objc;
313
314    /* Nonzero means this is an assembly file, and allow
315     * unknown directives, which could be comments.  */
316
317    int                 lang_asm;
318
319    /* Nonzero means turn NOTREACHED into #pragma NOTREACHED etc */
320
321    char                for_lint;
322
323    /* Nonzero means handle CHILL comment syntax
324     * and output CHILL string delimiter for __DATE___ etc. */
325
326    char                chill;
327
328    /* Nonzero means copy comments into the output file.  */
329
330    char                put_out_comments;
331
332    /* Nonzero means don't process the ANSI trigraph sequences.  */
333
334    char                no_trigraphs;
335
336    /* Nonzero means print the names of included files rather than
337     * the preprocessed output.  1 means just the #include "...",
338     * 2 means #include <...> as well.  */
339
340    char                print_deps;
341
342    /* Nonzero if missing .h files in -M output are assumed to be generated
343     * files and not errors.  */
344
345    char                print_deps_missing_files;
346
347    /* If true, fopen (deps_file, "a") else fopen (deps_file, "w"). */
348    char                print_deps_append;
349
350    /* Nonzero means print names of header files (-H).  */
351
352    char                print_include_names;
353
354    /* Nonzero means try to make failure to fit ANSI C an error.  */
355
356    char                pedantic_errors;
357
358    /* Nonzero means don't print warning messages.  -w.  */
359
360    char                inhibit_warnings;
361
362    /* Nonzero means warn if slash-star appears in a comment.  */
363
364    char                warn_comments;
365
366    /* Nonzero means warn if there are any trigraphs.  */
367
368    char                warn_trigraphs;
369
370    /* Nonzero means warn if #import is used.  */
371
372    char                warn_import;
373
374    /* Nonzero means warn if a macro argument is (or would be)
375     * stringified with -traditional.  */
376
377    char                warn_stringify;
378
379    /* Nonzero means turn warnings into errors.  */
380
381    char                warnings_are_errors;
382
383    /* Nonzero causes output not to be done,
384     * but directives such as #define that have side effects
385     * are still obeyed.  */
386
387    char                no_output;
388
389    /* Nonzero means don't output line number information.  */
390
391    char                no_line_commands;
392
393 /* Nonzero means output the text in failing conditionals,
394    inside #failed ... #endfailed.  */
395
396    char                output_conditionals;
397
398    /* Nonzero means -I- has been seen,
399     * so don't look for #include "foo" the source-file directory.  */
400    char                ignore_srcdir;
401
402 /* Zero means dollar signs are punctuation.
403    -$ stores 0; -traditional may store 1.  Default is 1 for VMS, 0 otherwise.
404    This must be 0 for correct processing of this ANSI C program:
405         #define foo(a) #a
406         #define lose(b) foo (b)
407         #define test$
408         lose (test)     */
409    char                dollars_in_ident;
410 #ifndef DOLLARS_IN_IDENTIFIERS
411 #define DOLLARS_IN_IDENTIFIERS 1
412 #endif
413
414    /* Nonzero means try to imitate old fashioned non-ANSI preprocessor.  */
415    char                traditional;
416
417    /* Nonzero means give all the error messages the ANSI standard requires.  */
418    char                pedantic;
419
420    char                done_initializing;
421
422    struct file_name_list *include;      /* First dir to search */
423    /* First dir to search for <file> */
424    /* This is the first element to use for #include <...>.
425     * If it is 0, use the entire chain for such includes.  */
426    struct file_name_list *first_bracket_include;
427    /* This is the first element in the chain that corresponds to
428     * a directory of system header files.  */
429    struct file_name_list *first_system_include;
430    struct file_name_list *last_include; /* Last in chain */
431
432    /* Chain of include directories to put at the end of the other chain.  */
433    struct file_name_list *after_include;
434    struct file_name_list *last_after_include;   /* Last in chain */
435
436    /* Chain to put at the start of the system include files.  */
437    struct file_name_list *before_system;
438    struct file_name_list *last_before_system;   /* Last in chain */
439
440    /* Directory prefix that should replace `/usr' in the standard
441     * include file directories.  */
442    char               *include_prefix;
443
444    char                inhibit_predefs;
445    char                no_standard_includes;
446    char                no_standard_cplusplus_includes;
447
448 /* dump_only means inhibit output of the preprocessed text
449              and instead output the definitions of all user-defined
450              macros in a form suitable for use as input to cccp.
451    dump_names means pass #define and the macro name through to output.
452    dump_definitions means pass the whole definition (plus #define) through
453 */
454
455    enum dump_type      dump_macros;
456
457 /* Nonzero means pass all #define and #undef directives which we actually
458    process through to the output stream.  This feature is used primarily
459    to allow cc1 to record the #defines and #undefs for the sake of
460    debuggers which understand about preprocessor macros, but it may
461    also be useful with -E to figure out how symbols are defined, and
462    where they are defined.  */
463    int                 debug_output;
464
465    /* Pending -D, -U and -A options, in reverse order. */
466    struct cpp_pending *pending;
467
468    /* File name which deps are being written to.
469     * This is 0 if deps are being written to stdout.  */
470    char               *deps_file;
471
472    /* Target-name to write with the dependency information.  */
473    char               *deps_target;
474 };
475
476 #define CPP_TRADITIONAL(PFILE) (CPP_OPTIONS(PFILE)-> traditional)
477 #define CPP_PEDANTIC(PFILE) (CPP_OPTIONS (PFILE)->pedantic)
478 #define CPP_PRINT_DEPS(PFILE) (CPP_OPTIONS (PFILE)->print_deps)
479
480 /* Name under which this program was invoked.  */
481
482 extern char        *progname;
483
484 /* The structure of a node in the hash table.  The hash table
485    has entries for all tokens defined by #define commands (type T_MACRO),
486    plus some special tokens like __LINE__ (these each have their own
487    type, and the appropriate code is run when that type of node is seen.
488    It does not contain control words like "#define", which are recognized
489    by a separate piece of code. */
490
491 /* different flavors of hash nodes --- also used in keyword table */
492 enum node_type {
493    T_DEFINE = 1,                /* the `#define' keyword */
494    T_INCLUDE,                   /* the `#include' keyword */
495    T_INCLUDE_NEXT,              /* the `#include_next' keyword */
496    T_IMPORT,                    /* the `#import' keyword */
497    T_IFDEF,                     /* the `#ifdef' keyword */
498    T_IFNDEF,                    /* the `#ifndef' keyword */
499    T_IF,                        /* the `#if' keyword */
500    T_ELSE,                      /* `#else' */
501    T_PRAGMA,                    /* `#pragma' */
502    T_ELIF,                      /* `#elif' */
503    T_UNDEF,                     /* `#undef' */
504    T_LINE,                      /* `#line' */
505    T_ERROR,                     /* `#error' */
506    T_WARNING,                   /* `#warning' */
507    T_ENDIF,                     /* `#endif' */
508    T_SCCS,                      /* `#sccs', used on system V.  */
509    T_IDENT,                     /* `#ident', used on system V.  */
510    T_ASSERT,                    /* `#assert', taken from system V.  */
511    T_UNASSERT,                  /* `#unassert', taken from system V.  */
512    T_SPECLINE,                  /* special symbol `__LINE__' */
513    T_DATE,                      /* `__DATE__' */
514    T_FILE,                      /* `__FILE__' */
515    T_BASE_FILE,                 /* `__BASE_FILE__' */
516    T_INCLUDE_LEVEL,             /* `__INCLUDE_LEVEL__' */
517    T_VERSION,                   /* `__VERSION__' */
518    T_SIZE_TYPE,                 /* `__SIZE_TYPE__' */
519    T_PTRDIFF_TYPE,              /* `__PTRDIFF_TYPE__' */
520    T_WCHAR_TYPE,                /* `__WCHAR_TYPE__' */
521    T_USER_LABEL_PREFIX_TYPE,    /* `__USER_LABEL_PREFIX__' */
522    T_REGISTER_PREFIX_TYPE,      /* `__REGISTER_PREFIX__' */
523    T_TIME,                      /* `__TIME__' */
524    T_CONST,                     /* Constant value, used by `__STDC__' */
525    T_MACRO,                     /* macro defined by `#define' */
526    T_DISABLED,                  /* macro temporarily turned off for rescan */
527    T_SPEC_DEFINED,              /* special `defined' macro for use in #if statements */
528    T_PCSTRING,                  /* precompiled string (hashval is KEYDEF *) */
529    T_UNUSED                     /* Used for something not defined.  */
530 };
531
532 /* Structure allocated for every #define.  For a simple replacement
533    such as
534         #define foo bar ,
535    nargs = -1, the `pattern' list is null, and the expansion is just
536    the replacement text.  Nargs = 0 means a functionlike macro with no args,
537    e.g.,
538        #define getchar() getc (stdin) .
539    When there are args, the expansion is the replacement text with the
540    args squashed out, and the reflist is a list describing how to
541    build the output from the input: e.g., "3 chars, then the 1st arg,
542    then 9 chars, then the 3rd arg, then 0 chars, then the 2nd arg".
543    The chars here come from the expansion.  Whatever is left of the
544    expansion after the last arg-occurrence is copied after that arg.
545    Note that the reflist can be arbitrarily long---
546    its length depends on the number of times the arguments appear in
547    the replacement text, not how many args there are.  Example:
548    #define f(x) x+x+x+x+x+x+x would have replacement text "++++++" and
549    pattern list
550      { (0, 1), (1, 1), (1, 1), ..., (1, 1), NULL }
551    where (x, y) means (nchars, argno). */
552
553 struct reflist {
554    struct reflist     *next;
555    char                stringify;       /* nonzero if this arg was preceded by a
556                                          * # operator. */
557    char                raw_before;      /* Nonzero if a ## operator before arg. */
558    char                raw_after;       /* Nonzero if a ## operator after arg. */
559    char                rest_args;       /* Nonzero if this arg. absorbs the rest */
560    int                 nchars;  /* Number of literal chars to copy before
561                                  * this arg occurrence.  */
562    int                 argno;   /* Number of arg to substitute (origin-0) */
563 };
564
565 typedef struct definition DEFINITION;
566 struct definition {
567    int                 nargs;
568    int                 length;  /* length of expansion string */
569    int                 predefined;      /* True if the macro was builtin or */
570    /* came from the command line */
571    unsigned char      *expansion;
572    int                 line;    /* Line number of definition */
573    const char         *file;    /* File of definition */
574    char                rest_args;       /* Nonzero if last arg. absorbs the rest */
575    struct reflist     *pattern;
576    union {
577       /* Names of macro args, concatenated in reverse order
578        * with comma-space between them.
579        * The only use of this is that we warn on redefinition
580        * if this differs between the old and new definitions.  */
581       unsigned char      *argnames;
582    } args;
583 };
584
585 extern unsigned char is_idchar[256];
586
587 /* Stack of conditionals currently in progress
588    (including both successful and failing conditionals).  */
589
590 struct if_stack {
591    struct if_stack    *next;    /* for chaining to the next stack frame */
592    const char         *fname;   /* copied from input when frame is made */
593    int                 lineno;  /* similarly */
594    int                 if_succeeded;    /* true if a leg of this if-group
595                                          * has been passed through rescan */
596    unsigned char      *control_macro;   /* For #ifndef at start of file,
597                                          * this is the macro name tested.  */
598    enum node_type      type;    /* type of last directive seen in this group */
599 };
600 typedef struct if_stack IF_STACK_FRAME;
601
602 extern void         cpp_buf_line_and_col(cpp_buffer *, long *, long *);
603 extern cpp_buffer  *cpp_file_buffer(cpp_reader *);
604 extern void         cpp_define(cpp_reader *, unsigned char *);
605
606 extern void         cpp_error(cpp_reader * pfile, const char *msg, ...);
607 extern void         cpp_warning(cpp_reader * pfile, const char *msg, ...);
608 extern void         cpp_pedwarn(cpp_reader * pfile, const char *msg, ...);
609 extern void         cpp_fatal(const char *msg, ...);
610 extern void         cpp_file_line_for_message(cpp_reader * pfile,
611                                               const char *filename, int line,
612                                               int column);
613 extern void         cpp_perror_with_name(cpp_reader * pfile, const char *name);
614 extern void         cpp_pfatal_with_name(cpp_reader * pfile, const char *name);
615 extern void         cpp_message(cpp_reader * pfile, int is_error,
616                                 const char *msg, ...);
617 extern void         cpp_message_v(cpp_reader * pfile, int is_error,
618                                   const char *msg, va_list args);
619
620 extern void         cpp_grow_buffer(cpp_reader * pfile, long n);
621 extern int          cpp_parse_escape(cpp_reader * pfile, char **string_ptr);
622
623 void                cpp_print_containing_files(cpp_reader * pfile);
624 HOST_WIDE_INT       cpp_parse_expr(cpp_reader * pfile);
625 void                skip_rest_of_line(cpp_reader * pfile);
626 void                init_parse_file(cpp_reader * pfile);
627 void                init_parse_options(struct cpp_options *opts);
628 int                 push_parse_file(cpp_reader * pfile, const char *fname);
629 void                cpp_finish(cpp_reader * pfile);
630 int                 cpp_read_check_assertion(cpp_reader * pfile);
631
632 void               *xmalloc(unsigned size);
633 void               *xrealloc(void *old, unsigned size);
634 void               *xcalloc(unsigned number, unsigned size);
635
636 #ifdef __EMX__
637 #define PATH_SEPARATOR ';'
638 #endif