/* Definitions for CPP library.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Per Bothner, 1994-95.
occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts. */
struct cpp_token
{
- fileline line; /* Logical line of first char of token. */
- unsigned short col; /* Column of first char of token. */
+ source_location src_loc; /* Location of first char of token. */
ENUM_BITFIELD(cpp_ttype) type : CHAR_BIT; /* token type */
unsigned char flags; /* flags - see above */
/* Nonzero means use extra default include directories for C++. */
unsigned char cplusplus;
- /* Nonzero means handle cplusplus style comments */
+ /* Nonzero means handle cplusplus style comments. */
unsigned char cplusplus_comments;
/* Nonzero means define __OBJC__, treat @ as a special token, and
promotions. */
unsigned char warn_num_sign_change;
+ /* Zero means don't warn about __VA_ARGS__ usage in c89 pedantic mode.
+ Presumably the usage is protected by the appropriate #ifdef. */
+ unsigned char warn_variadic_macros;
+
/* Nonzero means turn warnings into errors. */
unsigned char warnings_are_errors;
/* Holds the name of the target wide character set. */
const char *wide_charset;
+ /* Holds the name of the input character set. */
+ const char *input_charset;
+
/* True to warn about precompiled header files we couldn't use. */
bool warn_invalid_pch;
/* Nonzero means __STDC__ should have the value 0 in system headers. */
unsigned char stdc_0_in_system_headers;
-
- /* Nonzero means output a directory line marker right after the
- initial file name line marker, and before a duplicate initial
- line marker. */
- bool working_directory;
};
/* Call backs to cpplib client. */
/* Mapping of file names for this directory for MS-DOS and related
platforms. A NULL-terminated array of (from, to) pairs. */
const char **name_map;
-
+
/* The C front end uses these to recognize duplicated
directories in the search path. */
ino_t ino;
{
struct ht_identifier ident;
unsigned int is_directive : 1;
- unsigned int directive_index : 7; /* If is_directive,
+ unsigned int directive_index : 7; /* If is_directive,
then index into directive table.
Otherwise, a NODE_OPERATOR. */
unsigned char rid_code; /* Rid code - for front ends. */
pointer. Otherwise you should pass in an initialized hash table
that cpplib will share; this technique is used by the C front
ends. */
-extern cpp_reader *cpp_create_reader (enum c_lang, struct ht *);
+extern cpp_reader *cpp_create_reader (enum c_lang, struct ht *,
+ struct line_maps *);
/* Call this to change the selected language standard (e.g. because of
command line options). */
through the pointer returned from cpp_get_callbacks, or set them
with cpp_set_callbacks. */
extern cpp_options *cpp_get_options (cpp_reader *);
-extern const struct line_maps *cpp_get_line_maps (cpp_reader *);
extern cpp_callbacks *cpp_get_callbacks (cpp_reader *);
extern void cpp_set_callbacks (cpp_reader *, cpp_callbacks *);
-/* This function finds the main file, but does not start reading it.
- Returns true iff the file was found. */
-extern bool cpp_find_main_file (cpp_reader *, const char *);
-
-/* This function reads the file, but does not start preprocessing.
- This will generate at least one file change callback, and possibly
- a line change callback. */
-extern void cpp_push_main_file (cpp_reader *);
+/* This function reads the file, but does not start preprocessing. It
+ returns the name of the original file; this is the same as the
+ input file, except for preprocessed input. This will generate at
+ least one file change callback, and possibly a line change callback
+ too. If there was an error opening the file, it returns NULL. */
+extern const char *cpp_read_main_file (cpp_reader *, const char *);
/* Set up built-ins like __FILE__. */
extern void cpp_init_builtins (cpp_reader *, int);
extern bool cpp_interpret_string (cpp_reader *,
const cpp_string *, size_t,
cpp_string *, bool);
+extern bool cpp_interpret_string_notranslate (cpp_reader *,
+ const cpp_string *, size_t,
+ cpp_string *, bool);
/* Used to register macros and assertions, perhaps from the command line.
The text is the same as the command line argument. */
/* Same as cpp_error, except additionally specifies a position as a
(translation unit) physical line and physical column. If the line is
zero, then no location is printed. */
-extern void cpp_error_with_line (cpp_reader *, int, fileline, unsigned,
+extern void cpp_error_with_line (cpp_reader *, int, source_location, unsigned,
const char *msgid, ...) ATTRIBUTE_PRINTF_5;
/* In cpplex.c */