1 # generate prototypes for rsync
5 if (open(IN, '<', 'proto.h')) {
6 $old_protos = join('', <IN>);
18 my $protos = qq|/* This file is automatically generated with "make proto". DO NOT EDIT */\n\n|;
29 if (/^FN_(LOCAL|GLOBAL)_([^(]+)\(([^,()]+)/) {
30 my $ret = $FN_MAP{$2};
32 my $arg = $1 eq 'LOCAL' ? 'int ' : 'void';
33 $protos .= "$ret$func($arg);\n";
34 } elsif (/^static|^extern/ || /[;]/) {
36 } elsif (!/^[A-Za-z][A-Za-z0-9_]* /) {
38 } elsif (/[(].*[)][ \t]*$/) {
47 if ($old_protos ne $protos) {
48 open(OUT, '>', 'proto.h') or die $!;