make_html.pl 1.38 KB
Newer Older
ikits's avatar
ikits committed
1
#!/usr/bin/perl
ikits's avatar
ikits committed
2
##
ikits's avatar
ikits committed
3 4
## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
ikits's avatar
ikits committed
5 6 7 8
##
## This program is distributed under the terms and conditions of the GNU
## General Public License Version 2 as published by the Free Software
## Foundation or, at your option, any later version.
ikits's avatar
ikits committed
9 10 11 12

use strict;
use warnings;

13
use lib '.';
ikits's avatar
ikits committed
14 15 16 17 18 19 20 21 22 23 24 25
do 'bin/make.pl';

#---------------------------------------------------------------------------------------

my @extlist = ();
my %extensions = ();
my $group = "";
my $cur_group = "";

if (@ARGV)
{
    @extlist = @ARGV;
ikits's avatar
ikits committed
26 27
	my $n = 1;
	print "<table border=\"0\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" align=\"center\">\n";
ikits's avatar
ikits committed
28 29
	foreach my $ext (sort @extlist)
	{
30
		my ($extname, $exturl, $extstring, $reuse, $types, $tokens, $functions, $exacts) = parse_ext($ext);
ikits's avatar
ikits committed
31 32 33 34 35
		$cur_group = $extname;
		$cur_group =~ s/^(?:W?)GL(?:X?)_([A-Z0-9]+?)_.*$/$1/;
		$extname =~ s/^(?:W?)GL(?:X?)_(.*)$/$1/;
		if ($cur_group ne $group)
		{
36 37
			if ($group ne "")
			{
ikits's avatar
ikits committed
38
				print "<tr><td><br></td><td></td><td></td></tr>\n";
39
			}
ikits's avatar
ikits committed
40 41
			$group = $cur_group;
		}
ikits's avatar
ikits committed
42

ikits's avatar
ikits committed
43
		{
ikits's avatar
ikits committed
44 45 46 47 48 49 50 51 52
			if ($exturl)
			{
				print "<tr><td class=\"num\">$n</td><td>&nbsp;</td><td><a href=\"$exturl\">$extname</a></td></tr>\n";
			}
			else
			{
				print "<tr><td class=\"num\">$n</td><td>&nbsp;</td><td>$extname</td></tr>\n";
			}
			$n++;
ikits's avatar
ikits committed
53 54
		}
	}
ikits's avatar
ikits committed
55
	print "</table>\n"
ikits's avatar
ikits committed
56
}