-eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
- & eval 'exec perl -wS "$0" $argv:q'
- if 0;
+#!/usr/bin/perl
## Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson
## added -texinfo, -listfunc, -pkg-name
$type_struct, "\$1",
$type_param, "\$1" );
$blankline_text = "";
-
+my $lineprefix = "";
sub usage {
print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -tex | -texinfo -listfunc ]\n";
# print STDERR " :> @args\n";
$type = join " ", @args;
- if ($parameters{$param} eq "" && $param != "void") {
+ if ((!defined($parameters{$param}) || $parameters{$param} eq "") && $param ne "void") {
$parameters{$param} = "-- undescribed --";
print STDERR "warning: $lineno: Function parameter '$param' not described in '$function_name'\n";
}
# Split record into lines:
my @lines = split /\n/, $record;
+ my $max = @lines;
+ if ($max > 5) {
+ $max = 5;
+ }
+
+ if ($max < 2) {
+ return "";
+ }
my ($i) = 1;
my ($key) = $lines[$i];
- while( !($key =~ /^\@deftypefun/) && ($i < 5)) { $i=$i+1; $key = $lines[$i]; }
+ while( !($key =~ /^\@deftypefun/) && ($i < $max)) { $i=$i+1; $key = $lines[$i]; }
$key = $1 if $key =~ /^\@deftypefun {.*} {(.*)}/;
return $key;
}
-$/="@end deftypefun"; # Records are separated by blank lines.
+$/="\@end deftypefun"; # Records are separated by blank lines.
@records = <>; # Read in whole file, one record per array element.
@records = sort { key_of_record($a) cmp key_of_record($b) } @records;