summaryrefslogtreecommitdiff
path: root/support/list_hooks.pl
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2008-08-05 17:25:34 +0000
committerJim Jagielski <jim@apache.org>2008-08-05 17:25:34 +0000
commita822096ce2c2f00fdb062a32f5e138acc2fa4c83 (patch)
tree566c33a5598459d5e696139107f5bc4e83b71949 /support/list_hooks.pl
parent72e89c84a744b977205fff9153d71607210af0ea (diff)
downloadhttpd-a822096ce2c2f00fdb062a32f5e138acc2fa4c83.tar.gz
Make list_hooks.pl multi-line aware, and swallow up the
required lines to obtain args, etc... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@682814 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support/list_hooks.pl')
-rwxr-xr-xsupport/list_hooks.pl28
1 files changed, 14 insertions, 14 deletions
diff --git a/support/list_hooks.pl b/support/list_hooks.pl
index cb863db7ef..7a6c9332c3 100755
--- a/support/list_hooks.pl
+++ b/support/list_hooks.pl
@@ -59,16 +59,25 @@ sub findInDir {
sub scanFile {
my $file=shift;
-# print "scanning $file\n";
+# print "scanning $file\n";
open(F,$file) || croak "Can't open $file: $!";
while(<F>) {
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;
+ 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;
+ # swallow subsequent lines if needed to get all the required info
+ my $l=<F>;
+ return unless defined $l;
+ $l=~s/^\s*/ /;
+ $_.=$l;
+ }
+ $ret=~s/\s*$//;
+ $args=~s/^\s*//; $args=~s/\s*$//;
# print "found $ret $name($args) in $file\n";
croak "$name declared twice! ($_)"
@@ -76,15 +85,6 @@ sub scanFile {
$::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_IMPLEMENT_HOOK_()(VOID)\(([^,\s]+)/
|| /AP_IMPLEMENT(_OPTIONAL|)_HOOK_(.*?)\([^,]+?\s*,\s*([^,\s]+)/) {