'%s: Methods must belong to the same namespace as the '
'class they belong to' % (func.symbol, ))
return False
+ if first.direction == ast.PARAM_DIRECTION_OUT:
+ if func.is_method:
+ message.warn_node(func,
+ '%s: The first argument of methods cannot be an '
+ 'out-argument' % (func.symbol, ))
+ return False
# A quick hack here...in the future we should catch C signature/GI signature
# mismatches in a general way in finaltransformer
</parameter>
</parameters>
</method>
+ <function name="parse" c:identifier="regress_test_struct_a_parse">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="a_out"
+ direction="out"
+ caller-allocates="1"
+ transfer-ownership="none">
+ <doc xml:whitespace="preserve">the structure that is to be filled</doc>
+ <type name="TestStructA" c:type="RegressTestStructA*"/>
+ </parameter>
+ <parameter name="string" transfer-ownership="none">
+ <doc xml:whitespace="preserve">ignored</doc>
+ <type name="utf8" c:type="const gchar*"/>
+ </parameter>
+ </parameters>
+ </function>
</record>
<record name="TestStructB" c:type="RegressTestStructB">
<field name="some_int8" writable="1">
</parameter>
</parameters>
</function>
+ <function name="test_struct_a_parse"
+ c:identifier="regress_test_struct_a_parse"
+ moved-to="TestStructA.parse">
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="a_out"
+ direction="out"
+ caller-allocates="1"
+ transfer-ownership="none">
+ <doc xml:whitespace="preserve">the structure that is to be filled</doc>
+ <type name="TestStructA" c:type="RegressTestStructA*"/>
+ </parameter>
+ <parameter name="string" transfer-ownership="none">
+ <doc xml:whitespace="preserve">ignored</doc>
+ <type name="utf8" c:type="const gchar*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="test_strv_in" c:identifier="regress_test_strv_in">
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
*a_out = *a;
}
+/**
+ * regress_test_struct_a_parse:
+ * @a_out: (out caller-allocates): the structure that is to be filled
+ * @string: ignored
+ */
+void
+regress_test_struct_a_parse (RegressTestStructA *a_out,
+ const gchar *string)
+{
+ a_out->some_int = 23;
+}
+
/**
* regress_test_struct_b_clone:
* @b: the structure
void regress_test_struct_a_clone (RegressTestStructA *a,
RegressTestStructA *a_out);
+void regress_test_struct_a_parse (RegressTestStructA *a_out, const gchar *string);
struct _RegressTestStructB
{