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