3 # Copyright 2002 Patrik Stridvall
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 $0 =~ m
%^(.*?
/?tools)/winapi
/winapi_cleanup
$%;
24 require "$1/winapi/setup.pm";
27 use config
qw($current_dir $wine_dir);
28 use output qw($output);
29 use winapi_extract_options qw($options);
31 if($options->progress) {
32 $output->enable_progress;
34 $output->disable_progress;
37 ########################################################################
44 open(IN, "< $filename") || die "Can't open file '$filename'";
45 open(OUT, "> $filename.tmp") || die "Can't open file '$filename.tmp'";
47 my $result = &$function(\*IN, \*OUT, @_);
54 rename("$filename.tmp", $filename);
56 unlink("$filename.tmp");
62 ########################################################################
83 ########################################################################
86 my @h_files = $options->h_files;
87 my @c_files = $options->c_files;
90 my $progress_current = 0;
91 my $progress_max = scalar(@h_files) + scalar(@c_files);
93 foreach my $file (@h_files) {
95 $output->progress("$file (file $progress_current of $progress_max)");
97 if (edit_file($file, \&cleanup_file, @_)) {
98 $output->write("$file: modified\n");
102 foreach my $file (@c_files) {
104 $output->progress("$file (file $progress_current of $progress_max)");
106 if (edit_file($file, \&cleanup_file, @_)) {
107 $output->write("$file: modified\n");