gobject-introspection r522 - in trunk: girepository tests tests/invoke tools
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r522 - in trunk: girepository tests tests/invoke tools
- Date: Fri, 29 Aug 2008 18:19:27 +0000 (UTC)
Author: walters
Date: Fri Aug 29 18:19:26 2008
New Revision: 522
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=522&view=rev
Log:
Correctly handle GLib.List, GLib.Error etc
* girepository/girparser.c: Accept both List (for
compiling GLib) and GLib.List (what the scanner
generates).
* tests/ - Update.
* tools/generate.c: Generate canonical form.
Modified:
trunk/girepository/girparser.c
trunk/tests/boxed.gir
trunk/tests/invoke/testfns.gir
trunk/tools/generate.c
Modified: trunk/girepository/girparser.c
==============================================================================
--- trunk/girepository/girparser.c (original)
+++ trunk/girepository/girparser.c Fri Aug 29 18:19:26 2008
@@ -337,22 +337,26 @@
if (i < n_basic)
/* found a basic type */;
- else if (g_str_has_prefix (*rest, "GList") ||
- g_str_has_prefix (*rest, "GSList"))
- {
- if (g_str_has_prefix (*rest, "GList"))
+ else if (g_str_has_prefix (*rest, "GLib.List") ||
+ g_str_has_prefix (*rest, "GLib.SList") ||
+ g_str_has_prefix (*rest, "List") ||
+ g_str_has_prefix (*rest, "SList"))
+ {
+ if (g_str_has_prefix (*rest, "GLib."))
+ *rest += strlen ("GLib.");
+ if (g_str_has_prefix (*rest, "List"))
{
type->tag = GI_TYPE_TAG_GLIST;
type->is_glist = TRUE;
type->is_pointer = TRUE;
- *rest += strlen ("GList");
+ *rest += strlen ("List");
}
else
{
type->tag = GI_TYPE_TAG_GSLIST;
type->is_gslist = TRUE;
type->is_pointer = TRUE;
- *rest += strlen ("GSList");
+ *rest += strlen ("SList");
}
*rest = g_strchug (*rest);
@@ -376,12 +380,16 @@
type->parameter_type1 = create_pointer ();
}
}
- else if (g_str_has_prefix (*rest, "GHashTable"))
+ else if (g_str_has_prefix (*rest, "HashTable") ||
+ g_str_has_prefix (*rest, "GLib.HashTable"))
{
+ if (g_str_has_prefix (*rest, "GLib."))
+ *rest += strlen ("GLib.");
+
type->tag = GI_TYPE_TAG_GHASH;
type->is_ghashtable = TRUE;
type->is_pointer = TRUE;
- *rest += strlen ("GHashTable");
+ *rest += strlen ("HashTable");
*rest = g_strchug (*rest);
@@ -414,8 +422,12 @@
}
}
- else if (g_str_has_prefix (*rest, "GError"))
+ else if (g_str_has_prefix (*rest, "GLib.Error")
+ || g_str_has_prefix (*rest, "Error"))
{
+ if (g_str_has_prefix (*rest, "GLib."))
+ *rest += strlen ("GLib.");
+
type->tag = GI_TYPE_TAG_ERROR;
type->is_error = TRUE;
type->is_pointer = TRUE;
Modified: trunk/tests/boxed.gir
==============================================================================
--- trunk/tests/boxed.gir (original)
+++ trunk/tests/boxed.gir Fri Aug 29 18:19:26 2008
@@ -23,13 +23,13 @@
<type name="BoxedType1"/>
</parameter>
<parameter name="w" direction="in">
- <type name="GList<boxed2>"/>
+ <type name="GLib.List<boxed2>"/>
</parameter>
<parameter name="t" transfer="full" direction="in">
- <type name="GHashTable<utf8,int64>"/>
+ <type name="GLib.HashTable<utf8,int64>"/>
</parameter>
<parameter name="e" transfer="full" direction="out">
- <type name="GError"/>
+ <type name="GLib.Error"/>
</parameter>
</parameters>
</method>
Modified: trunk/tests/invoke/testfns.gir
==============================================================================
--- trunk/tests/invoke/testfns.gir (original)
+++ trunk/tests/invoke/testfns.gir Fri Aug 29 18:19:26 2008
@@ -71,7 +71,7 @@
</return-value>
<parameters>
<parameter name="list" direction="in">
- <type name="GList<gint>*" c:type="GList*"/>
+ <type name="GLib.List<gint>*" c:type="GList*"/>
</parameter>
</parameters>
</function>
@@ -83,7 +83,7 @@
</return-value>
<parameters>
<parameter name="list" direction="in">
- <type name="GList<utf8>*" c:type="GList*"/>
+ <type name="GLib.List<utf8>*" c:type="GList*"/>
</parameter>
</parameters>
</function>
Modified: trunk/tools/generate.c
==============================================================================
--- trunk/tools/generate.c (original)
+++ trunk/tools/generate.c Fri Aug 29 18:19:26 2008
@@ -107,7 +107,7 @@
else if (tag == 22)
{
type = g_type_info_get_param_type (info, 0);
- g_fprintf (file, "GList");
+ g_fprintf (file, "GLib.List");
if (type)
{
g_fprintf (file, "<");
@@ -119,7 +119,7 @@
else if (tag == 23)
{
type = g_type_info_get_param_type (info, 0);
- g_fprintf (file, "GSList");
+ g_fprintf (file, "GLib.SList");
if (type)
{
g_fprintf (file, "<");
@@ -131,7 +131,7 @@
else if (tag == 24)
{
type = g_type_info_get_param_type (info, 0);
- g_fprintf (file, "GHashTable");
+ g_fprintf (file, "GLib.HashTable");
if (type)
{
g_fprintf (file, "<");
@@ -148,7 +148,7 @@
{
gint n;
- g_fprintf (file, "GError");
+ g_fprintf (file, "GLib.Error");
n = g_type_info_get_n_error_domains (info);
if (n > 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]