gir/gtype-struct-name.gir \
gir/instance-parameter-owned.gir \
gir/method-array-length-type.gir \
+ gir/method-array-return.gir \
gir/method-class.gir \
gir/method-nowrapper.gir \
gir/parameter-array-length-type.gir \
+ gir/parameter-array-out.gir \
gir/parameter-nullable-out-simple-type.gir \
gir/property-non-readable.gir \
gir/signal-virtual.gir \
--- /dev/null
+<?xml version="1.0"?>
+<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+<include name="GObject" version="2.0"/>
+<include name="GLib" version="2.0"/>
+<include name="Gio" version="2.0"/>
+<package name="test"/>
+<c:include name="test.h"/>
+<namespace name="Test" version="1.0" shared-library="test" c:prefix="Test" c:identifier-prefixes="Test" c:symbol-prefixes="test">
+<function name="function" c:identifier="test_function">
+ <return-value transfer-ownership="full">
+ <array length="0" zero-terminated="0" c:type="char*">
+ <type name="utf8" c:type="char"/>
+ </array>
+ </return-value>
+ <parameters>
+ <parameter name="size" direction="out" transfer-ownership="full">
+ <type name="guint" c:type="unsigned int*"/>
+ </parameter>
+ </parameters>
+</function>
+</namespace>
+</repository>
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (array_length_pos = 0.1, array_length_type = "guint", cheader_filename = "test.h")]
+ public static char[] function ();
+}
--- /dev/null
+<?xml version="1.0"?>
+<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+<include name="GObject" version="2.0"/>
+<include name="GLib" version="2.0"/>
+<include name="Gio" version="2.0"/>
+<package name="test"/>
+<c:include name="test.h"/>
+<namespace name="Test" version="1.0" shared-library="test" c:prefix="Test" c:identifier-prefixes="Test" c:symbol-prefixes="test">
+<function name="function" c:identifier="test_function">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="size" direction="out" transfer-ownership="full">
+ <type name="guint" c:type="unsigned int*"/>
+ </parameter>
+ <parameter name="text" direction="out" transfer-ownership="full">
+ <array length="0" zero-terminated="0" c:type="char*">
+ <type name="utf8" c:type="char"/>
+ </array>
+ </parameter>
+ </parameters>
+</function>
+</namespace>
+</repository>
--- /dev/null
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+ [CCode (cheader_filename = "test.h")]
+ public static void function ([CCode (array_length_cname = "size", array_length_pos = 0.5, array_length_type = "guint")] out char[] text);
+}
} else {
bool known_type = true;
if (type_name == "utf8") {
- type_name = "string";
+ if (ctype == null || ctype.has_suffix ("*") || ctype == "gpointer" || ctype == "gconstpointer") {
+ type_name = "string";
+ } else {
+ //FIXME Work around a g-ir-scanner bug
+ type_name = "char";
+ }
} else if (type_name == "gboolean") {
type = new BooleanType ((Struct) context.root.scope.lookup ("bool"));
} else if (type_name == "gchar") {