carries all the options visible to the command line. */
struct cpp_options
{
- /* Name of input and output files. */
- const char *in_fname;
-
/* Characters between tab stops. */
unsigned int tabstop;
/* Pending options - -D, -U, -A, -I, -ixxx. */
struct cpp_pending *pending;
- /* File name which deps are being written to. This is 0 if deps are
- being written to stdout. */
- const char *deps_file;
-
/* Search paths for include files. */
struct search_path *quote_include; /* "" */
struct search_path *bracket_include; /* <> */
/* Nonzero means to allow hexadecimal floats and LL suffixes. */
unsigned char extended_numbers;
- /* Nonzero means print the names of included files rather than the
- preprocessed output. 1 means just the #include "...", 2 means
- #include <...> as well. */
- unsigned char print_deps;
-
- /* Nonzero if phony targets are created for each header. */
- unsigned char deps_phony_targets;
-
- /* Nonzero if missing .h files in -M output are assumed to be
- generated files and not errors. */
- unsigned char print_deps_missing_files;
-
- /* If true, fopen (deps_file, "a") else fopen (deps_file, "w"). */
- unsigned char print_deps_append;
-
/* Nonzero means print names of header files (-H). */
unsigned char print_include_names;
/* True for traditional preprocessing. */
unsigned char traditional;
+ /* Dependency generation. */
+ struct
+ {
+ /* Style of header dependencies to generate. */
+ enum {DEPS_NONE = 0, DEPS_USER, DEPS_SYSTEM } style;
+
+ /* Assume missing files are generated files. */
+ bool missing_files;
+
+ /* Generate phony targets for each dependency apart from the first
+ one. */
+ bool phony_targets;
+
+ /* If true, no dependency is generated on the main file. */
+ bool ignore_main_file;
+ } deps;
+
/* Target-specific features set by the front end or client. */
/* Precision for target CPP arithmetic, target characters, target
/* Now call cpp_handle_option[s] to handle 1[or more] switches. The
return value is the number of arguments used. If
cpp_handle_options returns without using all arguments, it couldn't
- understand the next switch. When there are no switches left, you
- must call cpp_post_options before calling cpp_read_main_file. Only
- after cpp_post_options are the contents of the cpp_options
- structure reliable. Options processing is not completed until you
- call cpp_finish_options. */
+ understand the next switch. Options processing is not completed
+ until you call cpp_finish_options. */
extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
extern int cpp_handle_option PARAMS ((cpp_reader *, int, char **));
-extern void cpp_post_options PARAMS ((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
from cpp_read_main_file, before they get debug callbacks. */
extern void cpp_finish_options PARAMS ((cpp_reader *));
+/* Call this to finish preprocessing. If you requested dependency
+ generation, pass an open stream to write the information to,
+ otherwise NULL. It is your responsibility to close the stream.
+
+ Returns cpp_errors (pfile). */
+extern int cpp_finish PARAMS ((cpp_reader *, FILE *deps_stream));
+
/* Call this to release the handle at the end of preprocessing. Any
use of the handle after this function returns is invalid. Returns
cpp_errors (pfile). */
const char *, const char *,
void (*) PARAMS ((cpp_reader *))));
-extern int cpp_finish PARAMS ((cpp_reader *, FILE *));
extern int cpp_avoid_paste PARAMS ((cpp_reader *, const cpp_token *,
const cpp_token *));
extern const cpp_token *cpp_get_token PARAMS ((cpp_reader *));
extern void cpp_make_system_header PARAMS ((cpp_reader *, int, int));
/* In cppmain.c */
-extern void cpp_preprocess_file PARAMS ((cpp_reader *, FILE *));
+extern void cpp_preprocess_file PARAMS ((cpp_reader *, const char *, FILE *));
#ifdef __cplusplus
}