man pages for kernel functions

Tim Waugh (twaugh@redhat.com)
Tue, 11 Apr 2000 11:42:40 +0100 (BST)


Here is a patch that tidies up the man output from the magic 'kernel-doc'
perl script.

<URL:ftp://people.redhat.com/twaugh/patches/patch-2.3.99-pre4-5-docstuff1.gz>

Here is a patch that tidies up some of the existing inline documentation.

<URL:ftp://people.redhat.com/twaugh/patches/patch-2.3.99-pre4-5-doc1.gz>

And here is a small perl script that does the impossible, and creates man
pages for nearly three hundred kernel functions.

Use it like this:

$ ./scripts/kernel-doc -man $(find -name '*.c') | split-man.pl /tmp/man

Have fun,

Tim.
*/

#!/usr/bin/perl

if ($#ARGV < 0) {
die "where do I put the results?\n";
}

mkdir $ARGV[0],0777 or die "Can't create $ARGV[0]: $!\n";
$state = 0;
while (<STDIN>) {
if (/^\.TH \"[^\"]*\" 4 \"([^\"]*)\"/) {
if ($state = 1) { close OUT }
$state = 1;
$fn = "$ARGV[0]/$1.4";
print STDERR "Creating $fn\n";
open OUT, ">$fn" or die "can't open $fn: $!\n";
print OUT $_;
} elsif ($state != 0) {
print OUT $_;
}
}

close OUT;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/