advapi32: Return ERROR_INVALID_PARAMETER for invalid crypt objects' handles.
[wine/zf.git] / tools / winapi / winapi_check_options.pm
blob8e1774429bf3ea2a51ad0b9a64b6ebc56f682d1f
2 # Copyright 1999, 2000, 2001 Patrik Stridvall
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 package winapi_check_options;
21 use strict;
22 use warnings 'all';
24 use base qw(options);
26 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
27 require Exporter;
29 @ISA = qw(Exporter);
30 @EXPORT = qw();
31 @EXPORT_OK = qw($options);
33 use config qw($current_dir $wine_dir);
34 use options qw($options parse_comma_list);
36 my %options_long = (
37 "debug" => { default => 0, description => "debug mode" },
38 "help" => { default => 0, description => "help mode" },
39 "verbose" => { default => 0, description => "verbose mode" },
41 "progress" => { default => 1, description => "show progress" },
43 "win16" => { default => 1, description => "Win16 checking" },
44 "win32" => { default => 1, description => "Win32 checking" },
46 "shared" => { default => 0, description => "show shared functions between Win16 and Win32" },
47 "shared-segmented" => { default => 0, description => "segmented shared functions between Win16 and Win32 checking" },
49 "config" => { default => 1, parent => "local", description => "check configuration include consistency" },
50 "config-unnecessary" => { default => 0, parent => "config", description => "check for unnecessary #include \"config.h\"" },
52 "spec-mismatch" => { default => 0, description => "spec file mismatch checking" },
54 "local" => { default => 1, description => "local checking" },
55 "module" => {
56 default => { active => 1, filter => 0, hash => {} },
57 parent => "local",
58 parser => \&parse_comma_list,
59 description => "module filter"
62 "argument" => { default => 1, parent => "local", description => "argument checking" },
63 "argument-count" => { default => 1, parent => "argument", description => "argument count checking" },
64 "argument-forbidden" => {
65 default => { active => 1, filter => 0, hash => {} },
66 parent => "argument",
67 parser => \&parse_comma_list,
68 description => "argument forbidden checking"
70 "argument-kind" => {
71 default => { active => 1, filter => 1, hash => { double => 1 } },
72 parent => "argument",
73 parser => \&parse_comma_list,
74 description => "argument kind checking"
76 "calling-convention" => { default => 1, parent => "local", description => "calling convention checking" },
77 "calling-convention-win16" => { default => 0, parent => "calling-convention", description => "calling convention checking (Win16)" },
78 "calling-convention-win32" => { default => 1, parent => "calling-convention", description => "calling convention checking (Win32)" },
79 "misplaced" => { default => 1, parent => "local", description => "check for misplaced functions" },
80 "statements" => { default => 0, parent => "local", description => "check for statements inconsistencies" },
81 "cross-call" => { default => 0, parent => ["statements", "win16", "win32"], description => "check for cross calling functions" },
82 "cross-call-win32-win16" => {
83 default => 0, parent => "cross-call", description => "check for cross calls between win32 and win16"
85 "cross-call-unicode-ascii" => {
86 default => 0, parent => "cross-call", description => "check for cross calls between Unicode and ASCII"
88 "debug-messages" => { default => 0, parent => "statements", description => "check for debug messages inconsistencies" },
90 "comments" => {
91 default => 1,
92 parent => "local",
93 description => "comments checking"
95 "comments-cplusplus" => {
96 default => 1,
97 parent => "comments",
98 description => "C++ comments checking"
101 "documentation" => {
102 default => 1,
103 parent => "local",
104 description => "check for documentation inconsistencies"
106 "documentation-pedantic" => {
107 default => 0,
108 parent => "documentation",
109 description => "be pedantic when checking for documentation inconsistencies"
112 "documentation-arguments" => {
113 default => 1,
114 parent => "documentation",
115 description => "check for arguments documentation inconsistencies\n"
117 "documentation-comment-indent" => {
118 default => 0,
119 parent => "documentation", description => "check for documentation comment indent inconsistencies"
121 "documentation-comment-width" => {
122 default => 0,
123 parent => "documentation", description => "check for documentation comment width inconsistencies"
125 "documentation-name" => {
126 default => 1,
127 parent => "documentation",
128 description => "check for documentation name inconsistencies\n"
130 "documentation-ordinal" => {
131 default => 1,
132 parent => "documentation",
133 description => "check for documentation ordinal inconsistencies\n"
135 "documentation-wrong" => {
136 default => 1,
137 parent => "documentation",
138 description => "check for wrong documentation\n"
141 "prototype" => {default => 0, parent => ["local", "headers"], description => "prototype checking" },
142 "global" => { default => 1, description => "global checking" },
143 "declared" => { default => 1, parent => "global", description => "declared checking" },
144 "implemented" => { default => 0, parent => "local", description => "implemented checking" },
145 "implemented-win32" => { default => 0, parent => "implemented", description => "implemented as win32 checking" },
146 "include" => { default => 1, parent => "global", description => "include checking" },
148 "headers" => { default => 0, description => "headers checking" },
149 "headers-duplicated" => { default => 0, parent => "headers", description => "duplicated function declarations checking" },
150 "headers-misplaced" => { default => 0, parent => "headers", description => "misplaced function declarations checking" },
151 "headers-needed" => { default => 1, parent => "headers", description => "headers needed checking" },
152 "headers-unused" => { default => 0, parent => "headers", description => "headers unused checking" },
155 my %options_short = (
156 "d" => "debug",
157 "?" => "help",
158 "v" => "verbose"
161 my $options_usage = "usage: winapi_check [--help] [<files>]\n";
163 $options = '_winapi_check_options'->new(\%options_long, \%options_short, $options_usage);
165 package _winapi_check_options;
167 use strict;
168 use warnings 'all';
170 use base qw(_options);
172 sub report_module($$) {
173 my $self = shift;
174 my $refvalue = $self->{MODULE};
176 my $name = shift;
178 if(defined($name)) {
179 return $$refvalue->{active} && (!$$refvalue->{filter} || $$refvalue->{hash}->{$name});
180 } else {
181 return 0;
185 sub report_argument_forbidden($$) {
186 my $self = shift;
187 my $refargument_forbidden = $self->{ARGUMENT_FORBIDDEN};
189 my $type = shift;
191 return $$refargument_forbidden->{active} && (!$$refargument_forbidden->{filter} || $$refargument_forbidden->{hash}->{$type});
194 sub report_argument_kind($$) {
195 my $self = shift;
196 my $refargument_kind = $self->{ARGUMENT_KIND};
198 my $kind = shift;
200 return $$refargument_kind->{active} && (!$$refargument_kind->{filter} || $$refargument_kind->{hash}->{$kind});