1 package winapi_check_options
;
6 use vars
qw($VERSION @ISA @EXPORT @EXPORT_OK);
11 @EXPORT_OK = qw($options);
13 use config qw($current_dir $wine_dir);
14 use options qw($options &parse_comma_list);
17 "debug" => { default => 0, description => "debug mode" },
18 "help" => { default => 0, description => "help mode" },
19 "verbose" => { default => 0, description => "verbose mode" },
21 "progress" => { default => 1, description => "show progress" },
23 "win16" => { default => 1, description => "Win16 checking" },
24 "win32" => { default => 1, description => "Win32 checking" },
26 "shared" => { default => 0, description => "show shared functions between Win16 and Win32" },
27 "shared-segmented" => { default => 0, description => "segmented shared functions between Win16 and Win32 checking" },
29 "config" => { default => 1, parent => "local", description => "check configuration include consistancy" },
30 "config-unnessary" => { default => 0, parent => "config", description => "check for unnessary #include \"config.h\"" },
32 "spec-mismatch" => { default => 0, description => "spec file mismatch checking" },
34 "local" => { default => 1, description => "local checking" },
36 default => { active => 1, filter => 0, hash => {} },
38 parser => \&parser_comma_list,
39 description => "module filter"
42 "argument" => { default => 1, parent => "local", description => "argument checking" },
43 "argument-count" => { default => 1, parent => "argument", description => "argument count checking" },
44 "argument-forbidden" => {
45 default => { active => 1, filter => 0, hash => {} },
47 parser => \&parser_comma_list,
48 description => "argument forbidden checking"
51 default => { active => 1, filter => 1, hash => { double => 1 } },
53 parser => \&parser_comma_list,
54 description => "argument kind checking"
56 "calling-convention" => { default => 1, parent => "local", description => "calling convention checking" },
57 "calling-convention-win16" => { default => 0, parent => "calling-convention", description => "calling convention checking (Win16)" },
58 "calling-convention-win32" => { default => 1, parent => "calling-convention", description => "calling convention checking (Win32)" },
59 "misplaced" => { default => 1, parent => "local", description => "check for misplaced functions" },
60 "statements" => { default => 0, parent => "local", description => "check for statements inconsistances" },
61 "cross-call" => { default => 0, parent => "statements", description => "check for cross calling functions" },
62 "cross-call-win32-win16" => {
63 default => 0, parent => "cross-call", description => "check for cross calls between win32 and win16"
65 "cross-call-unicode-ascii" => {
66 default => 0, parent => "cross-call", description => "check for cross calls between Unicode and ASCII"
68 "debug-messages" => { default => 0, parent => "statements", description => "check for debug messages inconsistances" },
73 description => "check for documentation inconsistances"
75 "documentation-pedantic" => {
77 parent => "documentation",
78 description => "be pendantic when checking for documentation inconsistances"
81 "documentation-arguments" => {
83 parent => "documentation",
84 description => "check for arguments documentation inconsistances\n"
86 "documentation-comment-indent" => {
88 parent => "documentation", description => "check for documentation comment indent inconsistances"
90 "documentation-comment-width" => {
92 parent => "documentation", description => "check for documentation comment width inconsistances"
94 "documentation-name" => {
96 parent => "documentation",
97 description => "check for documentation name inconsistances\n"
99 "documentation-ordinal" => {
101 parent => "documentation",
102 description => "check for documentation ordinal inconsistances\n"
104 "documentation-wrong" => {
106 parent => "documentation",
107 description => "check for wrong documentation\n"
110 "prototype" => {default => 0, parent => ["local", "headers"], description => "prototype checking" },
111 "global" => { default => 1, description => "global checking" },
112 "declared" => { default => 1, parent => "global", description => "declared checking" },
113 "implemented" => { default => 0, parent => "local", description => "implemented checking" },
114 "implemented-win32" => { default => 0, parent => "implemented", description => "implemented as win32 checking" },
115 "include" => { default => 1, parent => "global", description => "include checking" },
117 "headers" => { default => 0, description => "headers checking" },
118 "headers-duplicated" => { default => 0, parent => "headers", description => "duplicated function declarations checking" },
119 "headers-misplaced" => { default => 0, parent => "headers", description => "misplaced function declarations checking" },
120 "headers-needed" => { default => 1, parent => "headers", description => "headers needed checking" },
121 "headers-unused" => { default => 0, parent => "headers", description => "headers unused checking" },
124 my %options_short = (
130 my $options_usage = "usage: winapi_check [--help] [<files>]\n";
132 $options = '_winapi_check_options'->new(\%options_long, \%options_short, $options_usage);
134 package _winapi_check_options;
135 use base qw(_options);
141 my $refvalue = $self->{MODULE
};
146 return $$refvalue->{active
} && (!$$refvalue->{filter
} || $$refvalue->{hash
}->{$name});
152 sub report_argument_forbidden
{
154 my $refargument_forbidden = $self->{ARGUMENT_FORBIDDEN
};
158 return $$refargument_forbidden->{active
} && (!$$refargument_forbidden->{filter
} || $$refargument_forbidden->{hash
}->{$type});
161 sub report_argument_kind
{
163 my $refargument_kind = $self->{ARGUMENT_KIND
};
167 return $$refargument_kind->{active
} && (!$$refargument_kind->{filter
} || $$refargument_kind->{hash
}->{$kind});