mirror of
https://github.com/apache/httpd.git
synced 2025-08-06 11:06:17 +00:00
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
This commit is contained in:
@ -65,10 +65,19 @@ sub scanFile {
|
|||||||
while(<F>) {
|
while(<F>) {
|
||||||
next if /\#define/;
|
next if /\#define/;
|
||||||
next if /\@deffunc/;
|
next if /\@deffunc/;
|
||||||
if(/AP_DECLARE_HOOK\((.*)\)/) {
|
if(/AP_DECLARE_HOOK\s*\(/) {
|
||||||
my $def=$1;
|
my($ret,$name,$args);
|
||||||
my($ret,$name,$args)=$def=~/([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*\((.*)\)/;
|
while(!(($ret,$name,$args)=
|
||||||
croak "Don't understand $def in $file" if !defined $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";
|
# print "found $ret $name($args) in $file\n";
|
||||||
|
|
||||||
croak "$name declared twice! ($_)"
|
croak "$name declared twice! ($_)"
|
||||||
@ -76,15 +85,6 @@ sub scanFile {
|
|||||||
$::Hooks{$name}->{declared}=$file;
|
$::Hooks{$name}->{declared}=$file;
|
||||||
$::Hooks{$name}->{ret}=$ret;
|
$::Hooks{$name}->{ret}=$ret;
|
||||||
$::Hooks{$name}->{args}=$args;
|
$::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]+)/
|
if(/AP_IMPLEMENT_HOOK_()(VOID)\(([^,\s]+)/
|
||||||
|| /AP_IMPLEMENT(_OPTIONAL|)_HOOK_(.*?)\([^,]+?\s*,\s*([^,\s]+)/) {
|
|| /AP_IMPLEMENT(_OPTIONAL|)_HOOK_(.*?)\([^,]+?\s*,\s*([^,\s]+)/) {
|
||||||
|
Reference in New Issue
Block a user