print $fh "\t\t$name;\n\n";
} elsif ($flags =~ /n/) { # no args
print $fh "\t$ret\t$name\n\n";
- } elsif ($flags =~ /o/) { # no #define foo Perl_foo
- print $fh "\t$ret\tPerl_$name";
- print $fh "(" . (@args ? "pTHX_ " : "pTHX");
- print $fh join(", ", @args) . ")\n\n";
} else { # full usage
- print $fh "\t$ret\t$name";
- print $fh "(" . join(", ", @args) . ")";
- print $fh "\n\n";
+ my $p = $flags =~ /o/; # no #define foo Perl_foo
+ my $n = "Perl_"x$p . $name;
+ my $large_ret = length $ret > 7;
+ my $indent_size = 7+8 # nroff: 7 under =head + 8 under =item
+ +8+($large_ret ? 1 + length $ret : 8)
+ +length($n) + 1;
+ my $indent;
+ print $fh "\t$ret" . ($large_ret ? ' ' : "\t") . "$n(";
+ my $args = $p ? @args ? "pTHX_ " : "pTHX" : '';
+ my $first = 1;
+ while () {
+ if (!@args or
+ length $args
+ && $indent_size + 3 + length($args[0]) + length $args > 80
+ ) {
+ print $fh
+ $first ? '' : (
+ $indent //=
+ "\t".($large_ret ? " " x (1+length $ret) : "\t")
+ ." "x(1 + length $n)
+ ),
+ $args, (","x($args ne 'pTHX_ ') . "\n")x!!@args;
+ $args = $first = '';
+ }
+ @args or last;
+ $args .= ", "x!!(length $args && $args ne 'pTHX_ ')
+ . shift @args;
+ }
+ print $fh ")\n\n";
}
print $fh "=for hackers\nFound in file $file\n\n";
}
pod/perl.pod Verbatim line length including indents exceeds 80 by 9
pod/perlaix.pod Verbatim line length including indents exceeds 80 by 11
pod/perlapi.pod ? Should you be using L<...> instead of 86
-pod/perlapi.pod Verbatim line length including indents exceeds 80 by 154
+pod/perlapi.pod Verbatim line length including indents exceeds 80 by 24
pod/perlapi.pod unresolved internal link 3
pod/perlapio.pod Verbatim line length including indents exceeds 80 by 5
pod/perlbeos.pod ? Should you be using F<...> or maybe L<...> instead of 5
pod/perlhpux.pod Verbatim line length including indents exceeds 80 by 2
pod/perlhurd.pod Verbatim line length including indents exceeds 80 by 2
pod/perlintern.pod ? Should you be using L<...> instead of 5
-pod/perlintern.pod Verbatim line length including indents exceeds 80 by 22
+pod/perlintern.pod Verbatim line length including indents exceeds 80 by 17
pod/perlinterp.pod ? Should you be using L<...> instead of 1
pod/perlinterp.pod Verbatim line length including indents exceeds 80 by 1
pod/perlintro.pod Verbatim line length including indents exceeds 80 by 11