summaryrefslogtreecommitdiff
path: root/mkproto.pl
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2007-11-09 19:14:51 +0000
committerWayne Davison <wayned@samba.org>2007-11-09 19:14:51 +0000
commit4da09a65f84b2ebca6bf05e6b793868fc683b40f (patch)
treecd3187b210111451f696f36dc7a9d869d5cde36d /mkproto.pl
parentab9661098674ee9896cade4c3098100b14c94c93 (diff)
downloadrsync-4da09a65f84b2ebca6bf05e6b793868fc683b40f.tar.gz
Simplified script even more for HP-UX.
Diffstat (limited to 'mkproto.pl')
-rw-r--r--mkproto.pl23
1 files changed, 9 insertions, 14 deletions
diff --git a/mkproto.pl b/mkproto.pl
index e8f0e832..b989a5f6 100644
--- a/mkproto.pl
+++ b/mkproto.pl
@@ -1,21 +1,20 @@
# generate prototypes for rsync
-use strict;
-my $old_protos = '';
+$old_protos = '';
if (open(IN, 'proto.h')) {
$old_protos = join('', <IN>);
close IN;
}
-my %FN_MAP = (
+%FN_MAP = (
BOOL => 'BOOL ',
CHAR => 'char ',
INTEGER => 'int ',
STRING => 'char *',
);
-my $inheader = 0;
-my $protos = qq|/* This file is automatically generated with "make proto". DO NOT EDIT */\n\n|;
+$inheader = 0;
+$protos = qq|/* This file is automatically generated with "make proto". DO NOT EDIT */\n\n|;
while (<>) {
if ($inheader) {
@@ -24,16 +23,12 @@ while (<>) {
s/$/;/;
}
$protos .= $_;
- }
-
- if (/^FN_(LOCAL|GLOBAL)_([^(]+)\(([^,()]+)/) {
- my $ret = $FN_MAP{$2};
- my $func = $3;
- my $arg = $1 eq 'LOCAL' ? 'int ' : 'void';
+ } elsif (/^FN_(LOCAL|GLOBAL)_([^(]+)\(([^,()]+)/) {
+ $ret = $FN_MAP{$2};
+ $func = $3;
+ $arg = $1 eq 'LOCAL' ? 'int ' : 'void';
$protos .= "$ret$func($arg);\n";
- } elsif (/^static|^extern/ || /[;]/) {
- ;
- } elsif (!/^[A-Za-z][A-Za-z0-9_]* /) {
+ } elsif (/^static|^extern/ || /[;]/ || !/^[A-Za-z][A-Za-z0-9_]* /) {
;
} elsif (/[(].*[)][ \t]*$/) {
s/$/;/;