Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 81002 invoked from network); 14 Mar 2008 09:37:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2008 09:37:01 -0000 Received: (qmail 39061 invoked by uid 500); 14 Mar 2008 09:36:51 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 38998 invoked by uid 500); 14 Mar 2008 09:36:51 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 38987 invoked by uid 99); 14 Mar 2008 09:36:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Mar 2008 02:36:51 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of torsten.foertsch@gmx.net designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 14 Mar 2008 09:36:03 +0000 Received: (qmail invoked by alias); 14 Mar 2008 09:36:23 -0000 Received: from p57A5ED7A.dip.t-dialin.net (EHLO opi.home) [87.165.237.122] by mail.gmx.net (mp006) with SMTP; 14 Mar 2008 10:36:23 +0100 X-Authenticated: #1700068 X-Provags-ID: V01U2FsdGVkX1/I1jZGIk/I9id/yrVm+N2LWLIkj0fOG9AauQuaHy CN5fNREKWnvuju From: Torsten Foertsch To: dev@httpd.apache.org Subject: Re: [PATCH #21563] support/list_hooks.pl does not parse declarations that span multiple lines Date: Fri, 14 Mar 2008 10:36:20 +0100 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) References: <200802191554.25067.torsten.foertsch@gmx.net> In-Reply-To: <200802191554.25067.torsten.foertsch@gmx.net> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_Uck2HMxJC2j9hpo" Message-Id: <200803141036.20500.torsten.foertsch@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org --Boundary-00=_Uck2HMxJC2j9hpo Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue 19 Feb 2008, Torsten Foertsch wrote: > support/list_hooks.pl does not parse declarations that span multiple lines. > The attached version does. See also bug #44453. Please take this mail as a polite reminder since nobody has answered this patch for almost a month now. I understand support/list_hooks.pl is not the most important part of httpd but it is included in the shipped package. So, why don't we make it work? Torsten --Boundary-00=_Uck2HMxJC2j9hpo Content-Type: application/x-perl; name="list_hooks.pl" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="list_hooks.pl" #!/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 # 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 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. use strict; use Carp; my $path=shift || '.'; findInDir($path); foreach my $hook (sort keys %::Hooks) { my $h=$::Hooks{$hook}; for my $x (qw(declared implemented type args)) { print "$hook datum '$x' missing\n" if !exists $h->{$x}; } print "$hook\n"; print " declared in $h->{declared}\n" if defined $h->{declared}; print " implemented in $h->{implemented}\n" if defined $h->{implemented}; print " type is $h->{type}\n" if defined $h->{type}; print " $h->{ret} $hook($h->{args})\n" if defined $h->{args}; print "\n"; } #warn "found ".keys(%::Hooks)." hooks\n"; sub findInDir { my $path=shift; local(*D); opendir(D,$path) || croak "Can't open $path: $!"; while(my $f=readdir D) { next if $f=~/^\./; my $file="$path/$f"; if(-d $file) { findInDir($file); next; } next if $file !~ /\.[ch]$/; scanFile($file); } closedir D; } sub scanFile { my $file=shift; # print "scanning $file\n"; open(F,$file) || croak "Can't open $file: $!"; while() { next if /\#define/; next if /\@deffunc/; 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); # warn "found $name $type in $file\n"; croak "$name implemented twice ($::Hooks{$name}->{implemented} and $file) ($_)" if exists $::Hooks{$name}->{implemented}; $::Hooks{$name}->{implemented}=$file; $::Hooks{$name}->{type}=$type; } } } --Boundary-00=_Uck2HMxJC2j9hpo--