#!/usr/bin/perl -w # # by Elliot Lee %trans = ( "NONE"=>"void", "CHAR"=>"char", "BOOL"=>"gboolean", "INT"=>"gint", "UINT"=>"guint", "LONG"=>"glong", "ULONG"=>"gulong", "FLOAT"=>"gfloat", "DOUBLE"=>"gdouble", "STRING"=>"gpointer", "ENUM"=>"gint", "FLAGS"=>"gint", "BOXED"=>"gpointer", "FOREIGN"=>"gpointer", "CALLBACK"=>"gpointer", "POINTER"=>"gpointer", "ARGS"=>"gpointer", "SIGNAL"=>"gpointer", "C_CALLBACK"=>"gpointer"); open(IL, "<".$ENV{'srcdir'}."/gtkmarshal.list") || die("Open failed: $!"); open(OH, "|indent >".$ENV{'srcdir'}."/gtkmarshal.h") || die("Open failed: $!"); open(OS, "|indent >".$ENV{'srcdir'}."/gtkmarshal.c") || die("Open failed: $!"); print OH <)) { ($retval, $paramlist) = split(/:/, $aline, 2); @params = split(/\s*,\s*/, $paramlist); my $funcname = $retval."__".join("_",@params); next if (exists $defs{$funcname}); $doequiv = 0; for (@params, $retval) { if ($trans{$_} eq "gpointer") { $doequiv = 1; last; } } # Translate all function pointers to gpointer $defname = ""; if($doequiv) { print OH "#define gtk_marshal_$funcname "; $defs{$defname} = 1; for (@params, $retval) { if ($trans{$_} eq "gpointer") { $_ = "POINTER"; } } $funcname = $retval."__".join("_",@params); print OH "gtk_marshal_$funcname\n"; next if (exists $defs{$funcname}); } $defs{$funcname} = 1; print OH <