5 use setup qw($current_dir $wine_dir $winapi_dir $winapi_check_dir);
7 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
12 &file_absolutize &file_normalize
14 &file_type &files_filter
15 &file_skip &files_skip
16 &get_api_files &get_c_files &get_h_files &get_spec_files
19 $current_dir $wine_dir $winapi_dir $winapi_check_dir
22 use vars qw($current_dir $wine_dir $winapi_dir $winapi_check_dir);
24 use output qw($output);
31 $_ = file_absolutize($_);
33 m%^(?:libtest|rc|server|tests|tools)/% && return "";
34 m%^(?:programs|debugger|miscemu)/% && return "wineapp";
35 m%^(?:library|tsx11|unicode)/% && return "library";
36 m%^windows/x11drv/wineclipsrv\.c$% && return "application";
45 foreach my $file (@_) {
46 if(file_type($file) eq $type) {
57 $_ = file_absolutize($_);
59 m%^(?:libtest|programs|rc|server|tests|tools)/% && return 1;
60 m%^(?:debugger|miscemu|tsx11|server|unicode)/% && return 1;
61 m%^dlls/wineps/data/% && return 1;
62 m%^windows/x11drv/wineclipsrv\.c$% && return 1;
63 m%^dlls/winmm/wineoss/midipatch\.c$% && return 1;
64 m%(?:glue|spec)\.c$% && return 1;
71 foreach my $file (@_) {
72 if(!file_skip($file)) {
83 $_ = file_normalize($_);
84 if(!s%^$wine_dir/%%) {
85 $_ = "$current_dir/$_";
95 foreach my $dir (split(m%/%, $current_dir)) {
96 if(s%^(\.\./)*\.\./$dir/%%) {
103 while(m%^(.*?)([^/\.]+)/\.\./(.*?)$%) {
104 if($2 ne "." && $2 ne "..") {
117 $dir =~ s%/?[^/]*$%%;
126 my $extension = shift;
130 $output->progress("$wine_dir: searching for *.$extension");
139 while(defined(my $dir = shift @dirs)) {
141 my @entries= readdir(DIR);
149 } elsif(/\.$extension$/ && (!defined($type) || file_type($_) eq $type)) {
161 return _get_files("api", undef, "$winapi_check_dir/$name");
163 sub get_c_files { return _get_files("c", @_); }
164 sub get_h_files { return _get_files("h", @_); }
165 sub get_spec_files { return _get_files("spec", @_); }