# Has an optional arg, which is the directory to chdir to before reading
# MANIFEST and *.[ch].
#
-# This script is normally invoked as part of 'make all', but is also
-# called from regen.pl.
+# This script is invoked as part of 'make all'
#
# '=head1' are the only headings looked for. If the next line after the
# heading begins with a word character, it is considered to be the first line
my ($podname, $header, $dochash, $missing, $footer) = @_;
my $fh = open_new("pod/$podname.pod", undef,
{by => "$0 extracting documentation",
- from => 'the C source files'});
+ from => 'the C source files'}, 1);
print $fh $header;
};
}
-my $file;
# glob() picks up docs from extra .c or .h files that may be in unclean
# development trees.
-my $MANIFEST = do {
- local ($/, *FH);
- open FH, "MANIFEST" or die "Can't open MANIFEST: $!";
- <FH>;
-};
+open my $fh, '<', 'MANIFEST'
+ or die "Can't open MANIFEST: $!";
+while (my $line = <$fh>) {
+ next unless my ($file) = $line =~ /^(\S+\.[ch])\t/;
-for $file (($MANIFEST =~ /^(\S+\.c)\t/gm), ($MANIFEST =~ /^(\S+\.h)\t/gm)) {
open F, "< $file" or die "Cannot open $file for docs: $!\n";
$curheader = "Functions in file $file\n";
autodoc(\*F,$file);
close F or die "Error closing $file: $!\n";
}
+close $fh or die "Error whilst reading MANIFEST: $!";
for (sort keys %funcflags) {
next unless $funcflags{$_}{flags} =~ /d/;