Fixed breakage caused by mixing commits or something?
[projects/chimara/chimara.git] / docs / reference / build-selector-table.pl.in
1 #!@PERL@ -w
2 #
3 # Automatically builds section 11.1.6, "Table of Selectors", from the C code
4 # in gi_dispa.c.
5
6 my $in_list = 0;
7
8 print "<variablelist>\n";
9
10 while (<>) {
11         chomp;
12         if (/function_table\s*\[\]\s*=\s*{\s*$/) {
13                 $in_list = 1;
14                 next;
15         }
16         if ($in_list) {
17                 next if /^#/;
18                 last if /^};/;
19                 /{\s*(0x[0-9a-fA-F]{4}),\s*(\w*).*/;
20                 print "<varlistentry>\n";
21                 print "  <term><code>$1</code></term>\n";
22                 my $functionname = $2;
23                 my $linkname = '"' . $2 . '"';
24                 $linkname =~ s/_/-/g;
25                 print "  <listitem><para>\n";
26                 print "    <link linkend=$linkname><function>$functionname()</function></link>\n";
27                 print "  </para></listitem>\n";
28                 print "</varlistentry>\n";
29         }
30 }
31
32 print "</variablelist>\n";