OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [scripts/] [split-man] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#!/usr/bin/perl
2
#
3
#      split-man: create man pages from kernel-doc -man output
4
#
5
# Author:       Tim Waugh 
6
# Modified by:  Christoph Hellwig 
7
#
8
 
9
use strict;
10
 
11
die "$0: where do I put the results?\n" unless ($#ARGV >= 0);
12
die "$0: can't create $ARGV[0]: $!\n" unless mkdir $ARGV[0], 0777;
13
 
14
my $state = 0;
15
 
16
while () {
17
        s/&(\w+)/\\fB\1\\fP/g; # fix smgl uglinesses
18
        if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {
19
                close OUT unless ($state++ == 0);
20
                my $fn = "$ARGV[0]/$1.9";
21
                if (open OUT, ">$fn") {
22
                        print STDERR "creating $fn\n";
23
                } else {
24
                        die "can't open $fn: $!\n";
25
                }
26
 
27
                print OUT $_;
28
        } elsif ($state != 0) {
29
                print OUT $_;
30
        }
31
}
32
 
33
close OUT;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.