summaryrefslogtreecommitdiff
path: root/src/mcpp-lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mcpp-lib.h')
-rw-r--r--src/mcpp-lib.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/mcpp-lib.h b/src/mcpp-lib.h
new file mode 100644
index 0000000..6974672
--- /dev/null
+++ b/src/mcpp-lib.h
@@ -0,0 +1,65 @@
+#ifndef __MCPU_CPP_CPP_H__
+#define __MCPU_CPP_CPP_H__ 1
+
+#include <defs.h>
+#include <mcpp-config-file.h>
+#include <mcpp-include-path.h>
+#include <mcpp-language.h>
+#include <mcpp-macro.h>
+#include <mcpp-text.h>
+
+typedef struct mcpp_conditional mcpp_conditional;
+struct mcpp_conditional
+{
+ const char *filename;
+ unsigned line_number;
+ int parent_active;
+ int active;
+ int branch_succeeded;
+ int seen_else;
+};
+
+typedef struct mcpp_once_file mcpp_once_file;
+typedef struct mcpp_dependency mcpp_dependency;
+
+typedef struct mcpp mcpp;
+struct mcpp
+{
+ mcpp_options *options_data;
+ mcpu_config config;
+ mcpp_runtime_paths runtime_paths;
+ mcpu_include_paths include_paths;
+ enum mcpu_language lang_stack[MCPU_CPP_LANG_STACK_SIZE];
+ size_t lang_depth;
+ size_t include_depth;
+ mcpp_conditional conditional_stack[MCPU_CPP_CONDITIONAL_STACK_SIZE];
+ size_t conditional_depth;
+ char *base_filename;
+ char preprocess_date[16];
+ char preprocess_time[16];
+ int builtins_initialized;
+ int command_line_macros_applied;
+ mcpu_macro_table macros;
+ mcpp_once_file *once_files;
+ mcpp_dependency *dependencies_first;
+ mcpp_dependency *dependencies_last;
+ int verbose;
+ char *output_filename;
+ unsigned output_line;
+ mcpu_text output;
+};
+
+void mcpp_init( mcpp *cpp );
+void mcpp_free( mcpp *cpp );
+int mcpp_load_config( mcpp *cpp, const char *explicit_filename,
+ int no_config );
+int mcpp_prepare( mcpp *cpp );
+int mcpp_process( mcpp *cpp, const char *filename );
+int mcpp_process_stream( mcpp *cpp, FILE *stream, const char *name );
+int mcpp_dump_macros( mcpp *cpp, FILE *stream );
+int mcpp_write_output( mcpp *cpp, const char *filename );
+int mcpp_write_dependencies( mcpp *cpp, FILE *stream, int include_system );
+
+#define MCPP_OPTIONS(_cpp_) ((_cpp_)->options_data)
+
+#endif /* __MCPU_CPP_CPP_H__ */