diff --git a/ChangeLog b/ChangeLog index 16d383bb1..8df1a0b79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-11-13 Mike Kestner + + * */*-api.raw : rerun the parser for new vm-age and cleanups. + * parser/gapi_pp.pl : suppress union types, since we can't generate + them. smarter get_type regex. ignore #errors. + * parser/gapi2xml.pl : generate vm elements for GInterfaces. Deal + with G_CONST_RETURN in vms. deal with "struct _foo" types in method + prototypes. + 2004-11-13 Mike Kestner * sources/gda.patch : fix broken signal defs. diff --git a/atk/atk-api.raw b/atk/atk-api.raw index a0515c5f7..956062711 100644 --- a/atk/atk-api.raw +++ b/atk/atk-api.raw @@ -241,6 +241,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -286,6 +314,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -389,6 +473,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -450,6 +567,20 @@ + + + + + + + + + + + + + + @@ -499,6 +630,12 @@ + + + + + + @@ -513,6 +650,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -551,6 +715,19 @@ + + + + + + + + + + + + + @@ -621,6 +798,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -824,6 +1109,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -992,6 +1368,20 @@ + + + + + + + + + + + + + + @@ -1199,6 +1589,12 @@ + + + + + + @@ -1565,6 +1961,9 @@ + + + diff --git a/gda/gda-api.raw b/gda/gda-api.raw index 38bab8efc..b50b10148 100644 --- a/gda/gda-api.raw +++ b/gda/gda-api.raw @@ -138,15 +138,6 @@ - - - - - - - - - @@ -252,13 +243,6 @@ - - - - - - - @@ -457,37 +441,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + @@ -814,11 +780,10 @@ - + - @@ -828,21 +793,6 @@ - - - - - - - - - - - - - - - @@ -1214,12 +1164,6 @@ - - - - - - @@ -1329,13 +1273,6 @@ - - - - - - - diff --git a/gdk/gdk-api.raw b/gdk/gdk-api.raw index 88fee1bc4..9a7f196f2 100644 --- a/gdk/gdk-api.raw +++ b/gdk/gdk-api.raw @@ -664,16 +664,17 @@ - - + + - + + diff --git a/gnomedb/gnomedb-api.raw b/gnomedb/gnomedb-api.raw index fbfc87398..18ce5ec7c 100644 --- a/gnomedb/gnomedb-api.raw +++ b/gnomedb/gnomedb-api.raw @@ -35,13 +35,6 @@ - - - - - - - @@ -125,20 +118,6 @@ - - - - - - - - - - - - - - @@ -237,12 +216,6 @@ - - - - - - @@ -266,13 +239,6 @@ - - - - - - - @@ -397,12 +363,6 @@ - - - - - - @@ -509,20 +469,6 @@ - - - - - - - - - - - - - - @@ -664,16 +610,8 @@ - - - - - - - - @@ -822,12 +760,6 @@ - - - - - - diff --git a/gtk/gtk-api.raw b/gtk/gtk-api.raw index ae15a814e..825fe7664 100644 --- a/gtk/gtk-api.raw +++ b/gtk/gtk-api.raw @@ -1054,6 +1054,13 @@ + + + + + + + @@ -1071,6 +1078,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1153,6 +1192,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1248,6 +1318,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1467,6 +1592,20 @@ + + + + + + + + + + + + + + @@ -1502,6 +1641,20 @@ + + + + + + + + + + + + + + @@ -1536,6 +1689,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1651,6 +1889,14 @@ + + + + + + + + @@ -1670,6 +1916,20 @@ + + + + + + + + + + + + + + @@ -1734,6 +1994,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1905,6 +2215,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pango/pango-api.raw b/pango/pango-api.raw index ce5069c8b..2e3d6e086 100644 --- a/pango/pango-api.raw +++ b/pango/pango-api.raw @@ -1354,10 +1354,6 @@ - - - - diff --git a/parser/gapi2xml.pl b/parser/gapi2xml.pl index 146bf45e2..0221f5619 100755 --- a/parser/gapi2xml.pl +++ b/parser/gapi2xml.pl @@ -149,8 +149,8 @@ while ($line = ) { last if ($line =~ /^}/); } $typefuncs{lc($class)} = $pedef; - } elsif ($line =~ /^(deprecated)?(const|G_CONST_RETURN)?\s*\w+\s*\**\s*(\w+)\s*\(/) { - $fname = $3; + } elsif ($line =~ /^(deprecated)?(const|G_CONST_RETURN)?\s*(struct\s+)?\w+\s*\**\s*(\w+)\s*\(/) { + $fname = $4; $fdef = ""; while ($line !~ /;/) { $fdef .= $line; @@ -295,9 +295,10 @@ foreach $type (sort(keys(%ifaces))) { $classdef = $sdefs{$1} if ($ifacetype =~ /struct\s+(\w+)/); if ($initfunc) { - parseInitFunc($iface_el, $initfunc, 0); + parseInitFunc($iface_el, $initfunc); } else { warn "Don't have an init func for $inst.\n" if $debug; + addVirtualMethods ($classdef, $iface_el); } } @@ -350,7 +351,7 @@ foreach $type (sort(keys(%objects))) { # Get the props from the class_init func. if ($initfunc) { - parseInitFunc($obj_el, $initfunc, 1); + parseInitFunc($obj_el, $initfunc); } else { warn "Don't have an init func for $inst.\n" if $debug; } @@ -889,13 +890,13 @@ sub addSignalElem return $class; } - if ($class =~ /;\s*(G_CONST_RETURN)?\s*(\S+\s*\**)\s*\(\*\s*$method\)\s*\((.*?)\);/) { + if ($class =~ /;\s*(G_CONST_RETURN\s+)?(\w+\s*\**)\s*\(\*\s*$method\)\s*\((.*?)\);/) { $ret = $2; $parms = $3; addReturnElem($sig_elem, $ret); if ($parms && ($parms ne "void")) { addParamsElem($sig_elem, split(/,/, $parms)); } - $class =~ s/;\s*(G_CONST_RETURN)?\s*\S+\s*\**\s*\(\*\s*$method\)\s*\(.*?\);/;/; + $class =~ s/;\s*(G_CONST_RETURN\s+)?\w+\s*\**\s*\(\*\s*$method\)\s*\(.*?\);/;/; } else { die "$method $class"; } @@ -908,8 +909,8 @@ sub addVirtualMethods my ($class, $node) = @_; $class =~ s/\n\s*//g; - while ($class =~ /;\s*(\S+\s*\**)\s*\(\*\s*(\w+)\)\s*\((.*?)\);/) { - $ret = $1; $cname = $2; $parms = $3; + while ($class =~ /;\s*(G_CONST_RETURN\s+)?(\S+\s*\**)\s*\(\*\s*(\w+)\)\s*\((.*?)\);/) { + $ret = $1 . $2; $cname = $3; $parms = $4; if ($cname !~ /reserved/) { $vm_elem = $doc->createElement('virtual_method'); $node->appendChild($vm_elem); @@ -920,7 +921,7 @@ sub addVirtualMethods addParamsElem($vm_elem, split(/,/, $parms)); } } - $class =~ s/;\s*\S+\s*\**\s*\(\*\s*\w+\)\s*\(.*?\);//; + $class =~ s/;\s*(G_CONST_RETURN\s+)?\S+\s*\**\s*\(\*\s*\w+\)\s*\(.*?\);//; } } @@ -939,7 +940,7 @@ sub addImplementsElem sub parseInitFunc { - my ($obj_el, $initfunc, $is_obj) = @_; + my ($obj_el, $initfunc) = @_; my @init_lines = split (/\n/, $initfunc); @@ -975,9 +976,7 @@ sub parseInitFunc $linenum++; } - if ($is_obj) { - addVirtualMethods ($classdef, $obj_el); - } + addVirtualMethods ($classdef, $obj_el); } sub parseTypeFunc diff --git a/parser/gapi_pp.pl b/parser/gapi_pp.pl index 1fac125c7..da2c5a8d0 100755 --- a/parser/gapi_pp.pl +++ b/parser/gapi_pp.pl @@ -26,7 +26,7 @@ $private_regex = "^#if.*(ENABLE_BACKEND|ENABLE_ENGINE)"; $eatit_regex = "^#if.*(__cplusplus|DEBUG|DISABLE_COMPAT|ENABLE_BROKEN)"; -$ignoreit_regex = '^\s+\*|#ident|#\s*include|#\s*else|#\s*undef|G_(BEGIN|END)_DECLS|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN'; +$ignoreit_regex = '^\s+\*|#ident|#error|#\s*include|#\s*else|#\s*undef|G_(BEGIN|END)_DECLS|GDKVAR|GTKVAR|GTKMAIN_C_VAR|GTKTYPEUTILS_VAR|VARIABLE|GTKTYPEBUILTIN'; foreach $arg (@ARGV) { if (-d $arg && -e $arg) { @@ -144,6 +144,9 @@ foreach $fname (@hdrs) { print "};\n"; } elsif ($line =~ /^enum\s+\{/) { while ($line !~ /^};/) {$line = ;} + } elsif ($line =~ /^(typedef\s+)?union/) { + next if ($line =~ /^typedef\s+union\s+\w+\s+\w+;/); + while ($line !~ /^};/) {$line = ;} } elsif ($line =~ /(\s+)union\s*{/) { # this is a hack for now, but I need it for the fields to work $indent = $1; @@ -186,7 +189,7 @@ foreach $fname (@srcs, @privhdrs) { } while ($line = ) { - next if ($line !~ /^(struct|\w+_class_init|\w+_base_init|\w+_get_type)/); + next if ($line !~ /^(struct|\w+_class_init|\w+_base_init|\w+_get_type\b)/); if ($line =~ /^struct/) { # need some of these to parse out parent types