--- - 2008-02-19 15:46:58.789290304 +0100 +++ - 2008-02-19 15:27:24.000000000 +0100 @@ -1,4 +1,5 @@ #!/usr/bin/perl -w +# -*- mode:cperl;cperl-indent-level:4;cperl-continued-statement-offset:4;indent-tabs-mode:nil -*- # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -36,6 +37,8 @@ print "\n"; } +#warn "found ".keys(%::Hooks)." hooks\n"; + sub findInDir { my $path=shift; @@ -65,32 +68,31 @@ while() { next if /\#define/; next if /\@deffunc/; - if(/AP_DECLARE_HOOK\((.*)\)/) { - my $def=$1; - my($ret,$name,$args)=$def=~/([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*\((.*)\)/; - croak "Don't understand $def in $file" if !defined $args; -# print "found $ret $name($args) in $file\n"; - - croak "$name declared twice! ($_)" - if exists $::Hooks{$name}->{declared}; - $::Hooks{$name}->{declared}=$file; - $::Hooks{$name}->{ret}=$ret; - $::Hooks{$name}->{args}=$args; - } elsif(/AP_DECLARE_HOOK\((\s*[^,\s]+)\s*,\s*([^,\s]+)/) { -# really we should swallow subsequent lines to get the arguments... - my $name=$2; - my $ret=$1; - croak "$name declared twice! ($_)" - if exists $::Hooks{$name}->{declared}; - $::Hooks{$name}->{declared}=$file; - $::Hooks{$name}->{ret}=$ret; - $::Hooks{$name}->{args}='???'; + if(/AP_DECLARE_HOOK\s*\(/) { + my($ret,$name,$args); + while(!(($ret,$name,$args)= + /AP_DECLARE_HOOK\s*\(\s*([^,]+)\s*,\s*([^,\s]+)\s*,\s*\((.*?)\)\)/s)) { + chomp; + my $l=; + return unless defined $l; + $l=~s/^\s*/ /; + $_.=$l; + } + $ret=~s/\s*$//; + $args=~s/^\s*//; $args=~s/\s*$//; +# warn "found $ret $name($args) in $file\n"; + + croak "$name declared twice! ($_)" + if exists $::Hooks{$name}->{declared}; + $::Hooks{$name}->{declared}=$file; + $::Hooks{$name}->{ret}=$ret; + $::Hooks{$name}->{args}=$args; } if(/AP_IMPLEMENT_HOOK_()(VOID)\(([^,\s]+)/ || /AP_IMPLEMENT(_OPTIONAL|)_HOOK_(.*?)\([^,]+?\s*,\s*([^,\s]+)/) { my($type,$name)=($1 ? "OPTIONAL $2" : $2,$3); -# print "found $name $type in $file\n"; +# warn "found $name $type in $file\n"; croak "$name implemented twice ($::Hooks{$name}->{implemented} and $file) ($_)" if exists $::Hooks{$name}->{implemented};