This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for f0af002c73 (-DPERL_GLOBAL_STRUCT)
[perl5.git] / autodoc.pl
index 4c1d962..3b39696 100644 (file)
@@ -195,18 +195,31 @@ removed without notice.\n\n" if $flags =~ /x/;
                          +length($n) + 1;
        my $indent;
        print $fh "\t$ret" . ($large_ret ? ' ' : "\t") . "$n(";
-       my $args = $p ? @args ? "pTHX_ " : "pTHX" : '';
-       my $first = 1;
+       my $long_args;
+       for (@args) {
+           if ($indent_size + 2 + length > 79) {
+               $long_args=1;
+               $indent_size -= length($n) - 3;
+               last;
+           }
+       }
+       my $args = '';
+       if ($p) {
+           $args = @args ? "pTHX_ " : "pTHX";
+           if ($long_args) { print $fh $args; $args = '' }
+       }
+       $long_args and print $fh "\n";
+       my $first = !$long_args;
        while () {
            if (!@args or
                 length $args
-                && $indent_size + 3 + length($args[0]) + length $args > 80
+                && $indent_size + 3 + length($args[0]) + length $args > 79
            ) {
                print $fh
                  $first ? '' : (
                    $indent //=
                       "\t".($large_ret ? " " x (1+length $ret) : "\t")
-                     ." "x(1 + length $n)
+                     ." "x($long_args ? 4 : 1 + length $n)
                  ),
                  $args, (","x($args ne 'pTHX_ ') . "\n")x!!@args;
                $args = $first = '';
@@ -215,6 +228,7 @@ removed without notice.\n\n" if $flags =~ /x/;
            $args .= ", "x!!(length $args && $args ne 'pTHX_ ')
                   . shift @args;
        }
+       if ($long_args) { print $fh "\n", substr $indent, 0, -4 }
        print $fh ")\n\n";
     }
     print $fh "=for hackers\nFound in file $file\n\n";
@@ -257,14 +271,24 @@ _EOH_
 
     if (@$missing) {
         print $fh "\n=head1 Undocumented functions\n\n";
-    print $fh <<'_EOB_';
+    print $fh $podname eq 'perlapi' ? <<'_EOB_' : <<'_EOB_';
 The following functions have been flagged as part of the public API,
 but are currently undocumented. Use them at your own risk, as the
-interfaces are subject to change.
+interfaces are subject to change.  Functions that are not listed in this
+document are not intended for public use, and should NOT be used under any
+circumstances.
+
+If you use one of the undocumented functions below, you may wish to consider
+creating and submitting documentation for it. If your patch is accepted, this
+will indicate that the interface is stable (unless it is explicitly marked
+otherwise).
 
-If you use one of them, you may wish to consider creating and submitting
-documentation for it. If your patch is accepted, this will indicate that
-the interface is stable (unless it is explicitly marked otherwise).
+=over
+
+_EOB_
+The following functions are currently undocumented.  If you use one of
+them, you may wish to consider creating and submitting documentation for
+it.
 
 =over
 
@@ -361,7 +385,7 @@ perlapi - autogenerated documentation for the perl public API
 X<Perl API> X<API> X<api>
 
 This file contains the documentation of the perl public API generated by
-embed.pl, specifically a listing of functions, macros, flags, and variables
+F<embed.pl>, specifically a listing of functions, macros, flags, and variables
 that may be used by extension writers.  L<At the end|/Undocumented functions>
 is a list of functions which have yet to be documented.  The interfaces of
 those are subject to change without notice.  Any functions not listed here are
@@ -420,7 +444,9 @@ L<perlguts>, L<perlxs>, L<perlxstut>, L<perlintern>
 
 _EOE_
 
-my @missing_guts = grep $funcflags{$_}{flags} !~ /A/ && !$docs{guts}{$_}, keys %funcflags;
+# List of non-static internal functions
+my @missing_guts =
+ grep $funcflags{$_}{flags} !~ /[As]/ && !$docs{guts}{$_}, keys %funcflags;
 
 output('perlintern', <<'END', $docs{guts}, \@missing_guts, <<'END');
 =head1 NAME