From 6a214e7c32a6a4a159ba3f24312f4b519c6352af Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sat, 24 Jul 2010 17:31:52 +0100 Subject: modified parse_xsfuncs to output arguments as well --- docs/parse_xsfuncs.pl | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/parse_xsfuncs.pl b/docs/parse_xsfuncs.pl index 2a97516..d26cb2b 100755 --- a/docs/parse_xsfuncs.pl +++ b/docs/parse_xsfuncs.pl @@ -31,16 +31,37 @@ sub process_file { $parser->preprocess_pods; $parser->clean_out_empty_pods; - #print Dumper($parser->{data}), $/; +# print Dumper($parser->{data}), $/; my $data = $parser->{data}; foreach my $package (keys %$data) { #print "Package: $package\n"; my $subs = $data->{$package}->{xsubs}; foreach my $sub (@$subs) { + my $sub_name = $sub->{symname}; + + my $args_str = ''; + my @processed_args = (); + my $args = $sub->{args}; + + foreach my $arg (@$args) { + my $type = $arg->{type} // ''; + if ($type eq 'char *') { + $type = 'string'; + } elsif ($type eq 'SV *') { + $type = 'SVptr'; + } + my $aname = $arg->{name} // ''; + if ($aname eq '...') { + push @processed_args, '...'; + } else { + push @processed_args, $type . ' $' . $aname; + } + } + $args_str = join(", ", @processed_args); + next if $sub_name =~ m/::$/; - #print_msglevel($sub_name); - print $sub->{symname}, $/; + print $sub->{symname}, "(", $args_str, ")\n"; } } } -- cgit v1.2.3