diff options
| author | kx <kx@radix-linux.su> | 2026-10-01 12:02:28 +0300 |
|---|---|---|
| committer | kx <kx@radix-linux.su> | 2026-10-01 12:02:28 +0300 |
| commit | ba1b04d64bdfaf377915b22f77520216ebe47674 (patch) | |
| tree | 044343035c28b2b04ca9725f26e9b7c39342d19c /src/mcpp-options.h | |
| parent | 124b140798456778e2a96851cc7268aa9a726698 (diff) | |
| download | mcpu-cpp-1.0.2.tar.xz | |
Version 1.0.21.0.2
Diffstat (limited to 'src/mcpp-options.h')
| -rw-r--r-- | src/mcpp-options.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/mcpp-options.h b/src/mcpp-options.h new file mode 100644 index 0000000..910db92 --- /dev/null +++ b/src/mcpp-options.h @@ -0,0 +1,74 @@ +#ifndef __MCPU_CPP_OPTIONS_H__ +#define __MCPU_CPP_OPTIONS_H__ 1 + +enum mcpp_dump_macros +{ + MCPP_DUMP_NONE = 0, + MCPP_DUMP_ONLY, + MCPP_DUMP_DEFINITIONS +}; + +enum mcpp_option_action_kind +{ + MCPP_ACTION_DEFINE = 0, + MCPP_ACTION_UNDEF, + MCPP_ACTION_INCLUDE, + MCPP_ACTION_IMACROS, + MCPP_ACTION_INCLUDE_USER, + MCPP_ACTION_INCLUDE_SYSTEM, + MCPP_ACTION_INCLUDE_AFTER, + MCPP_ACTION_DEP_TARGET, + MCPP_ACTION_DEP_TARGET_QUOTED +}; + +typedef struct mcpp_option_action mcpp_option_action; +struct mcpp_option_action +{ + enum mcpp_option_action_kind kind; + const char *option; + const char *argument; +}; + +typedef struct mcpp_options mcpp_options; +struct mcpp_options +{ + const char *progname; + const char *in_fname; + const char *out_fname; + const char *config_fname; + const char *deps_file; + const char *deps_target; + const char *object_suffix; + + int help; + int version; + int verbose; + int no_config; + int dump_config; + int dump_search_dirs; + int no_standard_includes; + int no_standard_kplusplus_includes; + int inhibit_output; + int no_output; + int print_deps; + int print_deps_missing_files; + int inhibit_warnings; + int warn_comments; + int warn_comments_explicit; + int warnings_are_errors; + int for_lint; + enum mcpp_dump_macros dump_macros; + int dump_only_plus_predefined; + + mcpp_option_action *actions; + size_t action_count; + size_t action_capacity; +}; + +void mcpp_options_init( mcpp_options *opts, int argc ); +void mcpp_options_free( mcpp_options *opts ); +int mcpp_handle_options( mcpp_options *opts, int argc, char **argv ); +int mcpp_options_dump( const mcpp_options *opts, FILE *stream ); +int mcpp_options_has_unimplemented( const mcpp_options *opts ); + +#endif |
