From 5043fc9fd577bcc06623a8aad418a136c15a5928 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sun, 25 Apr 1999 11:17:44 +0000 Subject: Fix mkerr.pl to find functions returning function pointers (thanks Ulf!) also add a few missing prototypes. --- util/mkerr.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'util/mkerr.pl') diff --git a/util/mkerr.pl b/util/mkerr.pl index ccf766b9a0..60a3028bc6 100644 --- a/util/mkerr.pl +++ b/util/mkerr.pl @@ -66,7 +66,6 @@ while() } elsif (/^R\s+(\S+)\s+(\S+)/) { $rextra{$1} = $2; $rcodes{$1} = $2; - # Add extra reason with $1, value $2 } } @@ -114,20 +113,24 @@ while (($lib, $hdr) = each %hinc) foreach (split /;/, $def) { s/^[\n\s]*//g; s/[\n\s]*$//g; - next if (/\w+\W+(\w+)\W*\(\s*\)$/s); # K&R C - next if (/\(\*(\w*)\([^\)]+/); - if (/\w+\W+\w+\W*\(.*\)$/s) { + next if(/typedef\W/); + if (/\(\*(\w*)\([^\)]+/) { + my $name = $1; + $name =~ tr/[a-z]/[A-Z]/; + $ftrans{$name} = $1; + } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s){ + # K&R C + next ; + } elsif (/\w+\W+\w+\W*\(.*\)$/s) { while (not /\(\)$/s) { s/[^\(\)]*\)$/\)/s; s/\([^\(\)]*\)\)$/\)/s; } s/\(void\)//; /(\w+)\W*\(\)/s; - next if(/typedef\W/); my $name = $1; $name =~ tr/[a-z]/[A-Z]/; $ftrans{$name} = $1; - } elsif (/\(/ and not (/=/ or /DECLARE_STACK/)) { print STDERR "Header $hdr: cannot parse: $_;\n"; } -- cgit v1.2.3