Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
440b0215
Commit
440b0215
authored
Aug 28, 2002
by
Patrik Stridvall
Committed by
Alexandre Julliard
Aug 28, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New tool winapi_cleanup for doing simple automatic cleanups.
Currently it removes trailing white space from the .[ch] files.
parent
9aab47ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
161 additions
and
0 deletions
+161
-0
Makefile.in
tools/winapi/Makefile.in
+1
-0
winapi_cleanup
tools/winapi/winapi_cleanup
+109
-0
winapi_cleanup_options.pm
tools/winapi/winapi_cleanup_options.pm
+51
-0
No files found.
tools/winapi/Makefile.in
View file @
440b0215
...
...
@@ -11,6 +11,7 @@ install::
$(MKINSTALLDIRS)
$(bindir)
$(INSTALL_SCRIPT)
$(SRCDIR)
/trampoline
$(bindir)
/make_filter
$(INSTALL_SCRIPT)
$(SRCDIR)
/trampoline
$(bindir)
/winapi_check
$(INSTALL_SCRIPT)
$(SRCDIR)
/trampoline
$(bindir)
/winapi_cleanup
$(INSTALL_SCRIPT)
$(SRCDIR)
/trampoline
$(bindir)
/winapi_extract
$(INSTALL_SCRIPT)
$(SRCDIR)
/trampoline
$(bindir)
/winapi_fixup
...
...
tools/winapi/winapi_cleanup
0 → 100755
View file @
440b0215
#! /usr/bin/perl -w
# Copyright 2002 Patrik Stridvall
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
use
strict
;
BEGIN
{
$0
=~
m%^(.*?/?tools)/winapi/winapi_cleanup$%
;
require
"$1/winapi/setup.pm"
;
}
use
config
qw($current_dir $wine_dir)
;
use
output
qw($output)
;
use
winapi_extract_options
qw($options)
;
if
(
$options
->
progress
)
{
$output
->
enable_progress
;
}
else
{
$output
->
disable_progress
;
}
########################################################################
# edit_file
sub
edit_file
{
my
$filename
=
shift
;
my
$function
=
shift
;
open
(
IN
,
"< $filename"
)
||
die
"Can't open file '$filename'"
;
open
(
OUT
,
"> $filename.tmp"
)
||
die
"Can't open file '$filename.tmp'"
;
my
$result
=
&
$function
(
\*
IN
,
\*
OUT
,
@_
);
close
(
IN
);
close
(
OUT
);
if
(
$result
)
{
unlink
(
$filename
);
rename
(
"$filename.tmp"
,
$filename
);
}
else
{
unlink
(
"$filename.tmp"
);
}
return
$result
;
}
########################################################################
# cleanup_file
sub
cleanup_file
{
local
*
IN
=
shift
;
local
*
OUT
=
shift
;
my
$modified
=
0
;
while
(
<
IN
>
)
{
chomp
;
if
(
s/(.*?)\s+$/$1/
)
{
$modified
=
1
;
}
print
OUT
"$_\n"
;
}
return
$modified
;
}
########################################################################
# main
my
@h_files
=
$options
->
h_files
;
my
@c_files
=
$options
->
c_files
;
my
$progress_output
;
my
$progress_current
=
0
;
my
$progress_max
=
scalar
(
@h_files
)
+
scalar
(
@c_files
);
foreach
my
$file
(
@h_files
)
{
$progress_current
++
;
$output
->
progress
(
"$file (file $progress_current of $progress_max)"
);
if
(
edit_file
(
$file
,
\&
cleanup_file
,
@_
))
{
$output
->
write
(
"$file: modified\n"
);
}
}
foreach
my
$file
(
@c_files
)
{
$progress_current
++
;
$output
->
progress
(
"$file (file $progress_current of $progress_max)"
);
if
(
edit_file
(
$file
,
\&
cleanup_file
,
@_
))
{
$output
->
write
(
"$file: modified\n"
);
}
}
tools/winapi/winapi_cleanup_options.pm
0 → 100644
View file @
440b0215
#
# Copyright 2002 Patrik Stridvall
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
package
winapi_extract_options
;
use
base
qw(options)
;
use
strict
;
use
vars
qw($VERSION @ISA @EXPORT @EXPORT_OK)
;
require
Exporter
;
@ISA
=
qw(Exporter)
;
@EXPORT
=
qw()
;
@EXPORT_OK
=
qw($options)
;
use
options
qw($options &parse_comma_list)
;
my
%
options_long
=
(
"debug"
=>
{
default
=>
0
,
description
=>
"debug mode"
},
"help"
=>
{
default
=>
0
,
description
=>
"help mode"
},
"verbose"
=>
{
default
=>
0
,
description
=>
"verbose mode"
},
"progress"
=>
{
default
=>
1
,
description
=>
"show progress"
},
);
my
%
options_short
=
(
"d"
=>
"debug"
,
"?"
=>
"help"
,
"v"
=>
"verbose"
);
my
$options_usage
=
"usage: winapi_cleanup [--help] [<files>]\n"
;
$options
=
'_options'
->
new
(
\%
options_long
,
\%
options_short
,
$options_usage
);
1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment