httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r682814 - /httpd/httpd/trunk/support/list_hooks.pl
Date Tue, 05 Aug 2008 17:25:34 GMT
Author: jim
Date: Tue Aug  5 10:25:34 2008
New Revision: 682814

URL: http://svn.apache.org/viewvc?rev=682814&view=rev
Log:
Make list_hooks.pl multi-line aware, and swallow up the
required lines to obtain args, etc...

Modified:
    httpd/httpd/trunk/support/list_hooks.pl

Modified: httpd/httpd/trunk/support/list_hooks.pl
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/list_hooks.pl?rev=682814&r1=682813&r2=682814&view=diff
==============================================================================
--- httpd/httpd/trunk/support/list_hooks.pl (original)
+++ httpd/httpd/trunk/support/list_hooks.pl Tue Aug  5 10:25:34 2008
@@ -59,16 +59,25 @@
 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 @@
 	    $::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]+)/) {



Mime
View raw message