summaryrefslogtreecommitdiff
path: root/src/mcpp-options.h
blob: a4af123e1ad326c7e98b4a3d4c75c886fcd2241b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#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 *sys_root;
  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