Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 38 additions & 20 deletions autodoc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,27 @@
# Kept separate at end
my $undocumented_scn = 'Undocumented elements';

my @has_defs;
my @has_r_defs; # Reentrant symbols
my @include_defs;
my %list_only = (
has_defs => {
list => \@has_defs,
header => "List of capability C<HAS_I<foo>> symbols",
placement => '__HAS_LIST__',
},
has_r_defs => {
list => \@has_r_defs,
header => "List of capability C<HAS_I<foo>> symbols",
placement => '__HAS_R_LIST__',
},
include_defs => {
list => \@include_defs,
header => "List of C<#include> needed symbols",
placement => '__INCLUDE_LIST__',
},
);

my %valid_sections = (
$AV_scn => {},
$callback_scn => {},
Expand Down Expand Up @@ -281,7 +302,7 @@

footer => <<~EOT,

=head2 List of capability C<HAS_I<foo>> symbols
=head2 $list_only{has_defs}{header}

This is a list of those symbols that dont appear elsewhere in this
document that indicate if the current platform has a certain
Expand All @@ -300,11 +321,11 @@
split so that the ones that indicate there is a reentrant version
of a capability are listed separately

__HAS_LIST__
$list_only{has_defs}{placement}

And, the reentrant capabilities:

__HAS_R_LIST__
$list_only{has_r_defs}{placement}

Example usage:

Expand All @@ -318,15 +339,15 @@

=back

=head2 List of C<#include> needed symbols
=head2 $list_only{include_defs}{header}

This list contains symbols that indicate if certain C<#include>
files are present on the platform. If your code accesses the
functionality that one of these is for, you will need to
C<#include> it if the symbol on this list is C<#define>d. For
more detail, see the corresponding entry in F<$config_h>.

__INCLUDE_LIST__
$list_only{include_defs}{placement}

Example usage:

Expand Down Expand Up @@ -1069,9 +1090,6 @@ ($fh, $file)
}

my %configs;
my @has_defs;
my @has_r_defs; # Reentrant symbols
my @include_defs;

sub parse_config_h {
use re '/aa'; # Everything is ASCII in this file
Expand Down Expand Up @@ -2741,18 +2759,18 @@ ($destpod)
my $places_other_than_api = join ", ",
map { "L<$_>" } sort dictionary_order 'perlintern', @other_places;

# The S< > makes things less densely packed, hence more readable
my $has_defs_text .= join ",S< > ", map { "C<$_>" }
sort dictionary_order @has_defs;
my $has_r_defs_text .= join ",S< > ", map { "C<$_>" }
sort dictionary_order @has_r_defs;
$valid_sections{$genconfig_scn}{footer} =~ s/__HAS_LIST__/$has_defs_text/;
$valid_sections{$genconfig_scn}{footer} =~ s/__HAS_R_LIST__/$has_r_defs_text/;

my $include_defs_text .= join ",S< > ", map { "C<$_>" }
sort dictionary_order @include_defs;
$valid_sections{$genconfig_scn}{footer}
=~ s/__INCLUDE_LIST__/$include_defs_text/;

foreach my $name (keys %list_only) {
my @this_list = $list_only{$name}{list}->@*;
my $text = "";
foreach my $entry (sort dictionary_order @this_list) {
$text .= ",S< > " if $text; # The S< > makes things less densely
# packed, hence more readable
$text .= "C<$entry>";
}
$valid_sections{$genconfig_scn}{footer}
=~ s/$list_only{$name}{placement}/$text/;
}

my $section_list = join "\n\n", map { "=item L</$_>" }
sort(dictionary_order keys %valid_sections),
Expand Down
Loading