6
6
#
7
7
# pod/perlintern.pod
8
8
# pod/perlapi.pod
9
+
10
+ my $api = " pod/perlapi.pod" ;
11
+ my $intern = " pod/perlintern.pod" ;
9
12
#
10
13
# from information stored in
11
14
#
805
808
# are $1
806
809
my $flags = shift ;
807
810
return " unknown" if $flags eq " " ;
808
- return " api" if $flags =~ / A/ ;
809
- return " intern" ;
811
+ return $ api if $flags =~ / A/ ;
812
+ return $ intern ;
810
813
}
811
814
812
815
sub autodoc ($$) { # parse a file and extract documentation info
@@ -1344,20 +1347,20 @@ sub parse_config_h {
1344
1347
# Check if any section already has an entry for this element.
1345
1348
# If so, it better be a placeholder, in which case we replace it
1346
1349
# with this entry.
1347
- foreach my $section (keys $docs {' api' }-> %*) {
1348
- if (exists $docs {' api' }{$section }{$name }) {
1349
- my $was = $docs {' api' }{$section }{$name }-> {pod };
1350
+ foreach my $section (keys $docs {$ api }-> %*) {
1351
+ if (exists $docs {$ api }{$section }{$name }) {
1352
+ my $was = $docs {$ api }{$section }{$name }-> {pod };
1350
1353
$was = " " unless $was ;
1351
1354
chomp $was ;
1352
1355
if ($was ne " " && $was !~ m /$described_in / ) {
1353
1356
die " Multiple descriptions for $name \n "
1354
1357
. " The '$section ' section contained\n '$was '" ;
1355
1358
}
1356
- $docs {' api' }{$section }{$name }-> {pod } = $configs {$name }{pod };
1359
+ $docs {$ api }{$section }{$name }-> {pod } = $configs {$name }{pod };
1357
1360
$configs {$name }{section } = $section ;
1358
1361
last ;
1359
1362
}
1360
- elsif (exists $docs {' intern' }{$section }{$name }) {
1363
+ elsif (exists $docs {$ intern }{$section }{$name }) {
1361
1364
die " '$name ' is in '$config_h ' meaning it is part of the API,\n "
1362
1365
. " but it is also in 'perlintern', meaning it isn't API\n " ;
1363
1366
}
@@ -1571,9 +1574,9 @@ sub parse_config_h {
1571
1574
);
1572
1575
1573
1576
# All the information has been gathered; save it
1574
- push $docs {' api' }{$section }{$name }{items }-> @*, $data ;
1575
- $docs {' api' }{$section }{$name }{pod } = $configs {$name }{pod };
1576
- $docs {' api' }{$section }{$name }{usage }
1577
+ push $docs {$ api }{$section }{$name }{items }-> @*, $data ;
1578
+ $docs {$ api }{$section }{$name }{pod } = $configs {$name }{pod };
1579
+ $docs {$ api }{$section }{$name }{usage }
1577
1580
= $configs {$name }{usage } if defined $configs {$name }{usage };
1578
1581
}
1579
1582
}
@@ -2249,7 +2252,7 @@ ($)
2249
2252
# pod checkers.
2250
2253
s / ^\| // gm for $destpod -> {hdr }, $destpod -> {footer };
2251
2254
2252
- my $fh = open_new(" pod/ $podname .pod " , undef ,
2255
+ my $fh = open_new($podname , undef ,
2253
2256
{by => " $0 extracting documentation" ,
2254
2257
from => ' the C source files' }, 1);
2255
2258
@@ -2259,7 +2262,7 @@ ($)
2259
2262
my $section_info = $dochash -> {$section_name };
2260
2263
2261
2264
# We allow empty sections in perlintern.
2262
- if (! $section_info && $podname eq ' perlapi ' ) {
2265
+ if (! $section_info && $podname eq $api ) {
2263
2266
warn " Empty section '$section_name ' for $podname ; skipped" ;
2264
2267
next ;
2265
2268
}
@@ -2272,7 +2275,7 @@ ($)
2272
2275
delete $section_info -> {X_tags };
2273
2276
}
2274
2277
2275
- if ($podname eq ' perlapi ' ) {
2278
+ if ($podname eq $api ) {
2276
2279
print $fh " \n " , $valid_sections {$section_name }{header }, " \n "
2277
2280
if defined $valid_sections {$section_name }{header };
2278
2281
@@ -2311,13 +2314,13 @@ ($)
2311
2314
}
2312
2315
}
2313
2316
else {
2314
- my $pod_type = ($podname eq ' api' ) ? " public" : " internal" ;
2317
+ my $pod_type = ($podname eq $ api ) ? " public" : " internal" ;
2315
2318
print $fh " \n There are currently no $pod_type API items in " ,
2316
2319
$section_name , " \n " ;
2317
2320
}
2318
2321
2319
2322
print $fh " \n " , $valid_sections {$section_name }{footer }, " \n "
2320
- if $podname eq ' perlapi '
2323
+ if $podname eq $api
2321
2324
&& defined $valid_sections {$section_name }{footer };
2322
2325
}
2323
2326
@@ -2534,8 +2537,8 @@ ($)
2534
2537
2535
2538
# Here %docs is populated; and we're ready to output
2536
2539
2537
- my %api = ( podname => ' perlapi ' , docs => $docs {' api' } );
2538
- my %intern = ( podname => ' perlintern ' , docs => $docs {' intern' } );
2540
+ my %api = ( podname => $api , docs => $docs {$ api } );
2541
+ my %intern = ( podname => $intern , docs => $docs {$ intern } );
2539
2542
2540
2543
# But first, look for inconsistencies and populate the lists of elements whose
2541
2544
# documentation is missing
0 commit comments