diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2015-02-02 12:47:00 -0500 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2015-03-13 10:44:42 +0100 |
commit | 25d07c22a597f9da45a32dfb6d139b0a56631895 (patch) | |
tree | 5c7cb27d1a8e4f64faf7bfa44b7d42870d9cf227 /gtkdoc-scan.in | |
parent | 5f9727e48fdb15c2f0d299cbe5e5253ca6962c7c (diff) | |
download | gtk-doc-25d07c22a597f9da45a32dfb6d139b0a56631895.tar.gz |
scanner: special case G_DECLARE_*
https://bugzilla.gnome.org/show_bug.cgi?id=743879
Diffstat (limited to 'gtkdoc-scan.in')
-rwxr-xr-x | gtkdoc-scan.in | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in index dcb5e31..a45744a 100755 --- a/gtkdoc-scan.in +++ b/gtkdoc-scan.in @@ -578,6 +578,12 @@ sub ScanHeader { print DECL "<VARIABLE>\n<NAME>$symbol</NAME>\n$deprecated$decl</VARIABLE>\n"; } + # G_DECLARE_* + + } elsif (m/.*G_DECLARE_(FINAL_TYPE|DERIVABLE_TYPE|INTERFACE)\s*\(/) { + $in_declaration = "g-declare"; + $symbol = "G_DECLARE_$1"; + $decl = $'; # FUNCTIONS @@ -747,6 +753,24 @@ sub ScanHeader { # print "$in_declaration = $decl\n"; #} + if ($in_declaration eq "g-declare") { + if ($decl =~ s/\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*\).*$//) { + my $ModuleObjName = $1; + my $module_obj_name = $2; + if ($REBUILD_TYPES) { + push (@get_types, "${module_obj_name}_get_type"); + } + $forward_decls{$ModuleObjName} = "<STRUCT>\n<NAME>$ModuleObjName</NAME>\n$deprecated</STRUCT>\n"; + if ($symbol =~ /^G_DECLARE_DERIVABLE/) { + $forward_decls{"${ModuleObjName}Class"} = "<STRUCT>\n<NAME>${ModuleObjName}Class</NAME>\n$deprecated</STRUCT>\n"; + } + if ($symbol =~ /^G_DECLARE_INTERFACE/) { + $forward_decls{"${ModuleObjName}Interface"} = "<STRUCT>\n<NAME>${ModuleObjName}Interface</NAME>\n$deprecated</STRUCT>\n"; + } + $in_declaration = ""; + } + } + # Note that sometimes functions end in ') G_GNUC_PRINTF (2, 3);' or # ') __attribute__ (...);'. if ($in_declaration eq 'function') { |