|
232 | 232 | # Kept separate at end |
233 | 233 | my $undocumented_scn = 'Undocumented elements'; |
234 | 234 |
|
| 235 | +my @has_defs; |
| 236 | +my @has_r_defs; # Reentrant symbols |
| 237 | +my @include_defs; |
| 238 | +my %list_only = ( |
| 239 | + has_defs => { |
| 240 | + list => \@has_defs, |
| 241 | + header => "List of capability C<HAS_I<foo>> symbols", |
| 242 | + placement => '__HAS_LIST__', |
| 243 | + }, |
| 244 | + has_r_defs => { |
| 245 | + list => \@has_r_defs, |
| 246 | + header => "List of capability C<HAS_I<foo>> symbols", |
| 247 | + placement => '__HAS_R_LIST__', |
| 248 | + }, |
| 249 | + include_defs => { |
| 250 | + list => \@include_defs, |
| 251 | + header => "List of C<#include> needed symbols", |
| 252 | + placement => '__INCLUDE_LIST__', |
| 253 | + }, |
| 254 | +); |
| 255 | + |
235 | 256 | my %valid_sections = ( |
236 | 257 | $AV_scn => {}, |
237 | 258 | $callback_scn => {}, |
|
281 | 302 |
|
282 | 303 | footer => <<~EOT, |
283 | 304 |
|
284 | | - =head2 List of capability C<HAS_I<foo>> symbols |
| 305 | + =head2 $list_only{has_defs}{header} |
285 | 306 |
|
286 | 307 | This is a list of those symbols that dont appear elsewhere in this |
287 | 308 | document that indicate if the current platform has a certain |
|
300 | 321 | split so that the ones that indicate there is a reentrant version |
301 | 322 | of a capability are listed separately |
302 | 323 |
|
303 | | - __HAS_LIST__ |
| 324 | + $list_only{has_defs}{placement} |
304 | 325 |
|
305 | 326 | And, the reentrant capabilities: |
306 | 327 |
|
307 | | - __HAS_R_LIST__ |
| 328 | + $list_only{has_r_defs}{placement} |
308 | 329 |
|
309 | 330 | Example usage: |
310 | 331 |
|
|
318 | 339 |
|
319 | 340 | =back |
320 | 341 |
|
321 | | - =head2 List of C<#include> needed symbols |
| 342 | + =head2 $list_only{include_defs}{header} |
322 | 343 |
|
323 | 344 | This list contains symbols that indicate if certain C<#include> |
324 | 345 | files are present on the platform. If your code accesses the |
325 | 346 | functionality that one of these is for, you will need to |
326 | 347 | C<#include> it if the symbol on this list is C<#define>d. For |
327 | 348 | more detail, see the corresponding entry in F<$config_h>. |
328 | 349 |
|
329 | | - __INCLUDE_LIST__ |
| 350 | + $list_only{include_defs}{placement} |
330 | 351 |
|
331 | 352 | Example usage: |
332 | 353 |
|
@@ -1069,9 +1090,6 @@ ($fh, $file) |
1069 | 1090 | } |
1070 | 1091 |
|
1071 | 1092 | my %configs; |
1072 | | -my @has_defs; |
1073 | | -my @has_r_defs; # Reentrant symbols |
1074 | | -my @include_defs; |
1075 | 1093 |
|
1076 | 1094 | sub parse_config_h { |
1077 | 1095 | use re '/aa'; # Everything is ASCII in this file |
@@ -2741,18 +2759,18 @@ ($destpod) |
2741 | 2759 | my $places_other_than_api = join ", ", |
2742 | 2760 | map { "L<$_>" } sort dictionary_order 'perlintern', @other_places; |
2743 | 2761 |
|
2744 | | -# The S< > makes things less densely packed, hence more readable |
2745 | | -my $has_defs_text .= join ",S< > ", map { "C<$_>" } |
2746 | | - sort dictionary_order @has_defs; |
2747 | | -my $has_r_defs_text .= join ",S< > ", map { "C<$_>" } |
2748 | | - sort dictionary_order @has_r_defs; |
2749 | | -$valid_sections{$genconfig_scn}{footer} =~ s/__HAS_LIST__/$has_defs_text/; |
2750 | | -$valid_sections{$genconfig_scn}{footer} =~ s/__HAS_R_LIST__/$has_r_defs_text/; |
2751 | | - |
2752 | | -my $include_defs_text .= join ",S< > ", map { "C<$_>" } |
2753 | | - sort dictionary_order @include_defs; |
2754 | | -$valid_sections{$genconfig_scn}{footer} |
2755 | | - =~ s/__INCLUDE_LIST__/$include_defs_text/; |
| 2762 | + |
| 2763 | +foreach my $name (keys %list_only) { |
| 2764 | + my @this_list = $list_only{$name}{list}->@*; |
| 2765 | + my $text = ""; |
| 2766 | + foreach my $entry (sort dictionary_order @this_list) { |
| 2767 | + $text .= ",S< > " if $text; # The S< > makes things less densely |
| 2768 | + # packed, hence more readable |
| 2769 | + $text .= "C<$entry>"; |
| 2770 | + } |
| 2771 | + $valid_sections{$genconfig_scn}{footer} |
| 2772 | + =~ s/$list_only{$name}{placement}/$text/; |
| 2773 | +} |
2756 | 2774 |
|
2757 | 2775 | my $section_list = join "\n\n", map { "=item L</$_>" } |
2758 | 2776 | sort(dictionary_order keys %valid_sections), |
|
0 commit comments