added configure options for disabling python and ruby bindings
[comedilib.git] / doc / mkdr
1 #!/usr/bin/perl
2 # vim: set ts=4:
3
4 $manvolnum="3";
5 $header="#include <comedilib.h>";
6
7 $end = "";
8
9 print
10 "<!--This file is autogenerated.  Do not edit-->
11 <section>
12   <title>
13     Low-level drivers
14   </title>
15 ";
16
17 while(<>){
18         push @lines,$_;
19 }
20
21 $secend="";
22 $status="unknown";
23
24 while($s = shift @lines){
25         @x = $s;
26         if($s =~ m/^\w+\:/){
27                 $blank=0;
28                 chomp $s;
29                 $x = $s;
30                 LOOP: while($s = shift @lines){
31                         if($s =~ m/^\w+:/ or $s eq "\n"){
32                                 unshift @lines, $s;
33                                 last LOOP;
34                         }
35                         chomp $s;
36                         $x = "$x $s";
37                 }
38                 if($x =~ m/^Driver: (.*)/){
39                         $driver = $1;
40                 }elsif($x =~ m/^Description: (.*)/){
41                         $description = $1;
42                 }elsif($x =~ m/^Devices: (.*)/){
43                         $devices = $1;
44                 }elsif($x =~ m/^Author: (.*)/){
45                         $author = $1
46                 }elsif($x =~ m/^Status: (.*)/){
47                         $status = $1
48                 }
49         }else{
50                 if($s eq "\n"){
51                         $blank ++;
52                 }else{
53                         $blank = 0;
54                 }
55                 $comment = $comment . $s;
56         }
57         if($blank==3){
58                 $comment =~ s/&/&amp;/g;
59                 $comment =~ s/@/&#64;/g;
60                 $comment =~ s/</&lt;/g;
61                 $comment =~ s/>/&gt;/g;
62                 $author =~ s/&/&amp;/g;
63                 $author =~ s/@/&#64;/g;
64                 $author =~ s/</&lt;/g;
65                 $author =~ s/>/&gt;/g;
66                 print 
67 "
68 <section>
69   <title>
70 $driver -- $description
71   </title>
72   <para>
73 Author: $author
74   </para>
75   <para>
76 Status: $status
77   </para>
78 ";
79                 if($devices ne ""){
80                         print
81 "  <informaltable>
82   <tgroup cols='3' align='left'>
83   <thead>
84   <row>
85   <entry>Manufacturer</entry>
86   <entry>Device</entry>
87   <entry>Name</entry>
88   </row>
89   </thead>
90   <tbody>
91 ";
92                         while($devices){
93                                 $_=$devices;
94                                 if(m/^ *\[([^\]]+)\](.*)/){
95                                         $mfr = $1;
96                                         $devices = $2;
97                                 }elsif(m/^ *\(([^\)]+)\)(.*)/){
98                                         $name = $1;
99                                         $devices = $2;
100                                 }elsif(m/^ *([^\(,]+)(.*)/){
101                                         $dev = $1;
102                                         $devices = $2;
103                                         $dev =~ s/ *$//;
104                                 }elsif(m/^ *,(.*)/){
105                                         $devices = $1;
106                                         print
107 "    <row>
108       <entry>
109 $mfr
110       </entry>
111       <entry>
112 $dev
113       </entry>
114       <entry>
115 $name
116       </entry>
117     </row>
118 ";
119                                 }else{
120                                         die "parse error";
121                                 }
122                         }
123                         print
124 "    <row>
125       <entry>
126 $mfr
127       </entry>
128       <entry>
129 $dev
130       </entry>
131       <entry>
132 $name
133       </entry>
134     </row>
135         </tbody>
136         </tgroup>
137         </informaltable>
138 ";
139                 }
140                 print
141 "
142   <screen>
143 $comment
144   </screen>
145 </section>";
146                 $blank=0;
147
148                 $comment="";
149                 $status="unknown";
150         }
151 }
152
153 print
154 "</section>
155 ";
156
157 exit(0);
158