Commit 4da09a65 authored by Wayne Davison's avatar Wayne Davison

Simplified script even more for HP-UX.

parent ab966109
# generate prototypes for rsync # generate prototypes for rsync
use strict;
my $old_protos = ''; $old_protos = '';
if (open(IN, 'proto.h')) { if (open(IN, 'proto.h')) {
$old_protos = join('', <IN>); $old_protos = join('', <IN>);
close IN; close IN;
} }
my %FN_MAP = ( %FN_MAP = (
BOOL => 'BOOL ', BOOL => 'BOOL ',
CHAR => 'char ', CHAR => 'char ',
INTEGER => 'int ', INTEGER => 'int ',
STRING => 'char *', STRING => 'char *',
); );
my $inheader = 0; $inheader = 0;
my $protos = qq|/* This file is automatically generated with "make proto". DO NOT EDIT */\n\n|; $protos = qq|/* This file is automatically generated with "make proto". DO NOT EDIT */\n\n|;
while (<>) { while (<>) {
if ($inheader) { if ($inheader) {
...@@ -24,16 +23,12 @@ while (<>) { ...@@ -24,16 +23,12 @@ while (<>) {
s/$/;/; s/$/;/;
} }
$protos .= $_; $protos .= $_;
} } elsif (/^FN_(LOCAL|GLOBAL)_([^(]+)\(([^,()]+)/) {
$ret = $FN_MAP{$2};
if (/^FN_(LOCAL|GLOBAL)_([^(]+)\(([^,()]+)/) { $func = $3;
my $ret = $FN_MAP{$2}; $arg = $1 eq 'LOCAL' ? 'int ' : 'void';
my $func = $3;
my $arg = $1 eq 'LOCAL' ? 'int ' : 'void';
$protos .= "$ret$func($arg);\n"; $protos .= "$ret$func($arg);\n";
} elsif (/^static|^extern/ || /[;]/) { } elsif (/^static|^extern/ || /[;]/ || !/^[A-Za-z][A-Za-z0-9_]* /) {
;
} elsif (!/^[A-Za-z][A-Za-z0-9_]* /) {
; ;
} elsif (/[(].*[)][ \t]*$/) { } elsif (/[(].*[)][ \t]*$/) {
s/$/;/; s/$/;/;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment