summaryrefslogtreecommitdiff
path: root/tools/generate.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-05-27 00:17:56 -0300
committerJohan Dahlin <johan@gnome.org>2010-05-27 00:17:56 -0300
commit15cfa49be6976c0d8a5574164feca6b0212a7f4a (patch)
treea2475e3eefcc765c3422000689a881985777e8b0 /tools/generate.c
parente77f99fba5fce4dd0d4810707aa1aeac2ba0fb50 (diff)
downloadgobject-introspection-15cfa49be6976c0d8a5574164feca6b0212a7f4a.tar.gz
[g-ir-generate] Write out array type
For GLib arrays, write out the array type to the tgir
Diffstat (limited to 'tools/generate.c')
-rw-r--r--tools/generate.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/generate.c b/tools/generate.c
index 42772da1..39235962 100644
--- a/tools/generate.c
+++ b/tools/generate.c
@@ -221,9 +221,29 @@ write_type_info (const gchar *namespace,
else if (tag == GI_TYPE_TAG_ARRAY)
{
gint length, size;
+ char *name = NULL;
xml_start_element (file, "array");
+ switch (g_type_info_get_array_type (info)) {
+ case GI_ARRAY_TYPE_C:
+ break;
+ case GI_ARRAY_TYPE_ARRAY:
+ name = "GLib.Array";
+ break;
+ case GI_ARRAY_TYPE_PTR_ARRAY:
+ name = "GLib.PtrArray";
+ break;
+ case GI_ARRAY_TYPE_BYTE_ARRAY:
+ name = "GLib.ByteArray";
+ break;
+ default:
+ break;
+ }
+
+ if (name)
+ xml_printf (file, " name=\"%s\"", name);
+
type = g_type_info_get_param_type (info, 0);
length = g_type_info_get_array_length (info);