- API files update.
[wine.git] / tools / winapi_check / modules.pm
blob0ac93bb3f635bda91b8e7ad5fd4c7b7e128d1310
1 package modules;
3 use strict;
5 sub new {
6 my $proto = shift;
7 my $class = ref($proto) || $proto;
8 my $self = {};
9 bless ($self, $class);
11 my $options = \${$self->{OPTIONS}};
12 my $output = \${$self->{OUTPUT}};
13 my $modules = \%{$self->{MODULES}};
15 $$options = shift;
16 $$output = shift;
17 my $module_file = shift;
19 $module_file =~ s/^\.\///;
21 if($$options->progress) {
22 $$output->progress("$module_file");
25 my $allowed_dir;
26 my $spec_file;
28 open(IN, "< $module_file");
29 local $/ = "\n";
30 while(<IN>) {
31 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begining and end of line
32 s/^(.*?)\s*#.*$/$1/; # remove comments
33 /^$/ && next; # skip empty lines
35 if(/^%\s+(.*?)$/) {
36 $spec_file = $1;
37 next;
38 } else {
39 $allowed_dir = $1;
42 $$modules{$allowed_dir}{$spec_file}++;
44 close(IN);
46 return $self;