2000-10-18 15:50:13 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
print <<EOT;
|
2000-11-18 23:59:30 +00:00
|
|
|
typedef GtkWidget *(*GDoDemoFunc) (void);
|
|
|
|
|
2000-10-18 15:50:13 +00:00
|
|
|
typedef struct _Demo Demo;
|
|
|
|
|
|
|
|
struct _Demo
|
|
|
|
{
|
|
|
|
gchar *title;
|
|
|
|
gchar *filename;
|
2000-11-18 23:59:30 +00:00
|
|
|
GDoDemoFunc func;
|
2000-10-18 15:50:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
EOT
|
|
|
|
|
|
|
|
$array = "";
|
|
|
|
$first = 1;
|
|
|
|
for $file (@ARGV) {
|
|
|
|
|
|
|
|
($basename = $file) =~ s/\.c$//;
|
|
|
|
|
|
|
|
if ($first) {
|
|
|
|
$first = 0;
|
|
|
|
} else {
|
|
|
|
$array .= ",\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
open INFO_FILE, $file or die "Cannot open '$file'\n";
|
|
|
|
$title = <INFO_FILE>;
|
|
|
|
$title =~ s@^\s*/\*\s*@@;
|
|
|
|
$title =~ s@\s*$@@;
|
|
|
|
|
|
|
|
close INFO_FILE;
|
|
|
|
|
2000-11-18 23:59:30 +00:00
|
|
|
print "GtkWidget *do_$basename (void);\n";
|
2000-10-18 15:50:13 +00:00
|
|
|
$array .= qq( { "$title", "$file", do_$basename });
|
|
|
|
}
|
|
|
|
|
|
|
|
print "\nDemo testgtk_demos[] = {";
|
|
|
|
print $array;
|
|
|
|
print "\n};\n";
|