X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=support%2Flist_hooks.pl;h=7a6c9332c39df9e999187e7cd1357d96ddc5581c;hb=633a12126d456489ccccfd0bdbc2bffb57e30083;hp=33e34bbafce5a48a008f2559540812ff9564fc35;hpb=9687f8c6a7653267aef7c445cf1bd29378416543;p=apache diff --git a/support/list_hooks.pl b/support/list_hooks.pl index 33e34bbafc..7a6c9332c3 100755 --- a/support/list_hooks.pl +++ b/support/list_hooks.pl @@ -1,11 +1,11 @@ #!/usr/bin/perl -w # -# Copyright 2001-2005 The Apache Software Foundation or its licensors, as -# applicable. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # @@ -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() { 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=; + 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]+)/) {