perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/lib/Apache ParseSource.pm
Date Sun, 18 Feb 2001 21:52:51 GMT
dougm       01/02/18 13:52:51

  Modified:    lib/Apache ParseSource.pm
  Log:
  a few changes for subclass-able-ness
  
  Revision  Changes    Path
  1.6       +22 -7     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ParseSource.pm	2001/02/02 04:53:48	1.5
  +++ ParseSource.pm	2001/02/18 21:52:51	1.6
  @@ -50,11 +50,15 @@
   
       my $c = C::Scan->new(filename => $self->{scan_filename});
   
  -    $c->set(includeDirs => $self->config->includes);
  +    $c->set(includeDirs => $self->includes);
   
       bless $c, 'Apache::ParseSource::Scan';
   }
   
  +sub include_dir { shift->config->apxs(-q => 'INCLUDEDIR') }
  +
  +sub includes { shift->config->includes }
  +
   sub find_includes {
       my $self = shift;
   
  @@ -62,7 +66,7 @@
   
       require File::Find;
   
  -    my $dir = $self->config->apxs(-q => 'INCLUDEDIR');
  +    my $dir = $self->include_dir;
   
       unless (-d $dir) {
           die "could not find include directory";
  @@ -154,6 +158,10 @@
       return \@e;
   }
   
  +sub wanted_functions {
  +    join '|', qw(ap_ apr_ apu_);
  +}
  +
   sub get_functions {
       my $self = shift;
   
  @@ -165,7 +173,7 @@
       my $fdecls = $c->get($key);
   
       my %seen;
  -    my $wanted = join '|', qw(ap_ apr_ apu_);
  +    my $wanted = $self->wanted_functions;
   
       my @functions;
   
  @@ -174,6 +182,10 @@
           next unless $name =~ /^($wanted)/o;
           next if $seen{$name}++;
   
  +        for (qw(static __inline__)) {
  +            $rtype =~ s/^$_\s+//;
  +        }
  +
           my $func = {
              name => $name,
              return_type => $rtype,
  @@ -250,9 +262,11 @@
   
       require Data::Dumper;
       local $Data::Dumper::Indent = 1;
  +
  +    my($subdir) = (split '::', $name)[0];
   
  -    if (-d "lib/Apache") {
  -        $file = "lib/Apache/$file";
  +    if (-d "lib/$subdir") {
  +        $file = "lib/$subdir/$file";
       }
   
       open my $pm, '>', $file or die "open $file: $!";
  @@ -260,14 +274,15 @@
       my $dump = Data::Dumper->new([$data],
                                    [$name])->Dump;
   
  -    my $package = __PACKAGE__;
  +    my $package = ref($self) || $self;
  +    my $version = $self->VERSION;
       my $date = scalar localtime;
   
       print $pm <<EOF;
   package $name;
   
   # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  -# ! WARNING: generated by $package/$VERSION
  +# ! WARNING: generated by $package/$version
   # !          $date
   # !          do NOT edit, any changes will be lost !
   # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  
  
  

Mime
View raw message