dougm       01/03/03 15:08:59

  Modified:    lib/Apache ParseSource.pm
  Log:
  allow wanted prefixes to be specified
  
  Revision  Changes    Path
  1.10      +8 -6      modperl-2.0/lib/Apache/ParseSource.pm
  
  Index: ParseSource.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ParseSource.pm    2001/02/28 07:53:07     1.9
  +++ ParseSource.pm    2001/03/03 23:08:58     1.10
  @@ -14,6 +14,9 @@
           @_,
       }, $class;
   
  +    my $prefixes = join '|', @{ $self->{prefixes} || [qw(ap_ apr_)] };
  +    $self->{prefix_re} = qr{^($prefixes)};
  +
       $Apache::Build::APXS ||= $self->{apxs};
   
       $self;
  @@ -170,9 +173,8 @@
       return \@e;
   }
   
  -sub wanted_functions {
  -    join '|', qw(ap_ apr_ apu_);
  -}
  +sub wanted_functions  { shift->{prefix_re} }
  +sub wanted_structures { shift->{prefix_re} }
   
   sub get_functions {
       my $self = shift;
  @@ -191,7 +193,7 @@
   
       for my $entry (@$fdecls) {
           my($rtype, $name, $args) = @$entry;
  -        next unless $name =~ /^($wanted)/o;
  +        next unless $name =~ $wanted;
           next if $seen{$name}++;
   
           for (qw(static __inline__)) {
  @@ -223,7 +225,7 @@
       my $typedef_structs = $c->get($key);
   
       my %seen;
  -    my $prefix = join '|', qw(ap_ apr_ apu_);
  +    my $wanted = $self->wanted_structures;
       my $other  = join '|', qw(_rec module
                                 piped_log uri_components htaccess_result
                                 cmd_parms cmd_func cmd_how);
  @@ -232,7 +234,7 @@
       my $sx = qr(^struct\s+);
   
       while (my($type, $elts) = each %$typedef_structs) {
  -        next unless $type =~ /^($prefix)/o or $type =~ /($other)$/o;
  +        next unless $type =~ $wanted or $type =~ /($other)$/o;
   
           $type =~ s/$sx//;
   
  
  
  

Reply via email to