~ubuntu-branches/ubuntu/feisty/comedilib/feisty

« back to all changes in this revision

Viewing changes to doc/mkref

  • Committer: Bazaar Package Importer
  • Author(s): David Schleef
  • Date: 2003-09-23 18:11:12 UTC
  • Revision ID: james.westby@ubuntu.com-20030923181112-sat05jyh702rb1at
Tags: upstream-0.7.21
ImportĀ upstreamĀ versionĀ 0.7.21

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# vim: set ts=4:
 
3
 
 
4
$manvolnum="3";
 
5
$header="#include <comedilib.h>";
 
6
 
 
7
$end = "";
 
8
$refentry_end = "";
 
9
 
 
10
print
 
11
"<!--This file is autogenerated.  Do not edit-->
 
12
<section id=\"functionreference\">
 
13
  <title>
 
14
    Comedi Function Reference
 
15
  </title>
 
16
";
 
17
 
 
18
while($s = <>){
 
19
        chomp $s;
 
20
        if($s =~ m/^Function: (.*)/){
 
21
                $funcname = $1;
 
22
                $refpurpose = "";
 
23
                if($s =~ m/^Function: (.*) -- (.*)/){
 
24
                        $funcname = $1;
 
25
                        $refpurpose = $2;
 
26
                }
 
27
                $refname = $funcname;
 
28
                $refname =~ s/_/-/g;
 
29
                $refname = "func-ref-" . $refname;
 
30
                print $end;
 
31
                print $refentry_end;
 
32
                $refentry_end =
 
33
"</refentry>
 
34
";
 
35
                print
 
36
"<refentry id=\"$refname\">
 
37
 
 
38
  <refmeta>
 
39
    <refentrytitle>$funcname</refentrytitle>
 
40
    <manvolnum>$manvolnum</manvolnum>
 
41
  </refmeta>
 
42
 
 
43
  <refnamediv>
 
44
    <refname>$funcname</refname>
 
45
    <refpurpose>$refpurpose</refpurpose>
 
46
  </refnamediv>
 
47
";
 
48
                $end = "";
 
49
        }elsif($s =~ m/^Retval: (.*)/){
 
50
                print
 
51
"  <refsynopsisdiv>
 
52
    <funcsynopsis>
 
53
      <funcsynopsisinfo>$header</funcsynopsisinfo>
 
54
      <funcprototype>
 
55
        <funcdef>$1 <function>$funcname</function></funcdef>
 
56
";
 
57
                $end =
 
58
"      </funcprototype>
 
59
    </funcsynopsis>
 
60
  </refsynopsisdiv>
 
61
";
 
62
        }elsif($s =~ m/^Param: (.*)/){
 
63
                $p = $1;
 
64
                $p =~ m/(.*) (.*)/;
 
65
                print
 
66
"        <paramdef>$1 <parameter>$2</parameter></paramdef>
 
67
"
 
68
        }elsif($s =~ m/^Description:/){
 
69
                print $end;
 
70
                print
 
71
"  <refsect1>
 
72
    <title>
 
73
      Description
 
74
    </title>
 
75
    <para>
 
76
";
 
77
                $end =
 
78
"    </para>
 
79
  </refsect1>
 
80
";
 
81
        }elsif($s =~ m/^Returns:/){
 
82
                print $end;
 
83
                print
 
84
"  <refsect1>
 
85
    <title>
 
86
      Return value
 
87
    </title>
 
88
    <para>
 
89
";
 
90
                $end =
 
91
"    </para>
 
92
  </refsect1>
 
93
";
 
94
        }elsif($s =~ m/^Status: (.*)/){
 
95
                print $end;
 
96
                print
 
97
"  <refsect1>
 
98
    <title>
 
99
      Status
 
100
    </title>
 
101
    <para>
 
102
          $1
 
103
";
 
104
                $end =
 
105
"    </para>
 
106
  </refsect1>
 
107
";
 
108
        }elsif($s eq ""){
 
109
                print "</para><para>\n";
 
110
        }elsif($s =~ m/^ (.*)/){
 
111
                print "$1\n";
 
112
        }
 
113
}
 
114
 
 
115
print $end;
 
116
print $refentry_end;
 
117
print
 
118
"</section>
 
119
";
 
120
 
 
121
exit(0);
 
122