You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ben Laurie <be...@algroup.co.uk> on 2001/02/02 18:12:05 UTC

Re: cvs commit: apr-util/include apr_hooks.h

dougm@apache.org wrote:
> 
> dougm       01/02/01 21:56:12
> 
>   Modified:    include  apr_getopt.h apr_hash.h
>                include  apr_hooks.h
>   Log:
>   be consistent with 'const char * const *' spacing (noticed when parsing the tree with C::Scan)

What's C::Scan??

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Re: cvs commit: apr-util/include apr_hooks.h

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 2 Feb 2001, Greg Stein wrote:
 
> Are those "ap" structures from Apache? Conversely, they aren't appearing
> within APR(UTIL) are they?

the list of "ap" structures is below, ap_LINK_* make up 20 of the 39
reported.

ap_bucket_error
ap_directive_t
ap_filter_func
ap_filter_rec_t
ap_filter_t
ap_LINK_access_checker_t
ap_LINK_auth_checker_t
ap_LINK_check_user_id_t
ap_LINK_child_init_t
ap_LINK_default_port_t
ap_LINK_fixups_t
ap_LINK_handler_t
ap_LINK_header_parser_t
ap_LINK_http_method_t
ap_LINK_insert_filter_t
ap_LINK_log_transaction_t
ap_LINK_open_logs_t
ap_LINK_optional_fn_retrieve_t
ap_LINK_post_config_t
ap_LINK_post_read_request_t
ap_LINK_pre_config_t
ap_LINK_pre_connection_t
ap_LINK_process_connection_t
ap_LINK_translate_name_t
ap_LINK_type_checker_t
ap_method_list_t
ap_status_table_row_t
ap_text
ap_text_header
ap_xml_attr
ap_xml_doc
ap_xml_elem
command_rec
conn_rec
module
process_rec
request_rec
server_addr_rec
server_rec


Re: cvs commit: apr-util/include apr_hooks.h

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Feb 02, 2001 at 10:59:59AM -0800, Doug MacEachern wrote:
>...
> i'm planning to use these tables for generating most of the modperl-2.0
> glue code.  but it can be used for whatever, here's some sorta neato
> stats (probably not 100% accurate):
> 
> % perl util/source_stats.pl
> 80 typedefs
>    apr: 55
>     ap: 25
> 71 typedef_structs
>    apr: 32
>     ap: 39
> 609 functions
>    apr: 319
>     ap: 290
> 431 struct_members
>    apr: 147
>     ap: 284

Are those "ap" structures from Apache? Conversely, they aren't appearing
within APR(UTIL) are they?

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: cvs commit: apr-util/include apr_hooks.h

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 2 Feb 2001, Ben Laurie wrote:
 
> What's C::Scan??

http://www.cpan.org/modules/by-module/C/

i'm using a wrapper around it (Apache::ParseSource), that spits out two
other modules which are Perl structures containing the parsed header
files.  Apache::FunctionTable entries look like so:

  {
    'return_type' => 'int',
    'name' => 'ap_set_keepalive',
    'args' => [
      {
        'type' => 'request_rec *',
        'name' => 'r'
      }
    ],
  }

and Apache::StructureTable entries like so:

  {
    'type' => 'server_addr_rec',
    'elts' => [
      {
        'type' => 'server_addr_rec *',
        'name' => 'next'
      },
      {
        'type' => 'apr_sockaddr_t *',
        'name' => 'host_addr'
      },
      {
        'type' => 'apr_port_t',
        'name' => 'host_port'
      },
      {
        'type' => 'char *',
        'name' => 'virthost'
      }
    ],
  },

i'm planning to use these tables for generating most of the modperl-2.0
glue code.  but it can be used for whatever, here's some sorta neato
stats (probably not 100% accurate):

% perl util/source_stats.pl
80 typedefs
   apr: 55
    ap: 25
71 typedef_structs
   apr: 32
    ap: 39
609 functions
   apr: 319
    ap: 290
431 struct_members
   apr: 147
    ap: 284

% cat util/source_stats.pl

use strict;
use Apache::FunctionTable ();
use Apache::StructureTable ();

my %stats;

for my $entry (@$Apache::FunctionTable) {
    unless ($entry->{name} =~ /^(ap|apr)_/) {
        print "found alien function $entry->{name}\n";
    }

    $stats{functions}->{$1}++;
}

for my $entry (@$Apache::StructureTable) {
    my $elts = $entry->{elts};
    my $type = $entry->{type};

    my $c = $type =~ /^apr_/ ? "apr" : "ap";

    if (@$elts) {
        $stats{typedef_structs}->{$c}++;
        $stats{struct_members}->{$c} += @$elts;
    }
    else {
        $stats{typedefs}->{$c}++;
    }
}

while (my($name, $tab) = each %stats) {
    printf "%d %s\n", $tab->{ap} + $tab->{apr}, $name;
    for (qw(apr ap)) {
        printf "%6s: %d\n", $_, $tab->{$_};
    }
}