+2008-03-11 Philip Van Hoof <me@pvanhoof.be>
+
+ * tools/scannerlexer.l:
+ * tools/scanner.c:
+ * tests/parser/Foo-expected.gidl:
+ * tests/parser/foo.c:
+ * tests/parser/Makefile.am:
+ * tests/parser/foo-object.h:
+
+ Added a few extra tests. Which resulted in finding a few
+ bugs. Which resulted in me fixing those bugs
+
2008-03-11 Rob Taylor <rob.taylor@codethink.co.uk>
* tools/gidlcompilercontext.c: (g_idl_compiler_write_dir_entry),
<member name="FOO_FLAGS_THIRD" value="4"/>
</flags>
<object name="FooObject" parent="GLib.Object" type-name="FooObject" get-type="foo_object_get_type">
+ <method name="calleeowns" symbol="foo_object_calleeowns">
+ <return-type type="gint"/>
+ <parameters>
+ <parameter name="object" type="FooObject*"/>
+ <parameter name="toown" type="GObject*" transfer="full/>
+ </parameters>
+ </method>
+ <method name="calleesowns" symbol="foo_object_calleesowns">
+ <return-type type="gint"/>
+ <parameters>
+ <parameter name="object" type="FooObject*"/>
+ <parameter name="toown1" type="GObject*" transfer="full/>
+ <parameter name="toown2" type="GObject*" transfer="full/>
+ </parameters>
+ </method>
<method name="create_object" symbol="foo_object_create_object">
<return-type type="GObject*" transfer="full"/>
<parameters>
<parameter name="object" type="FooObject*"/>
</parameters>
</method>
+ <method name="in" symbol="foo_object_in">
+ <return-type type="gint"/>
+ <parameters>
+ <parameter name="object" type="FooObject*"/>
+ <parameter name="inarg" type="int*"/>
+ </parameters>
+ </method>
+ <method name="inout" symbol="foo_object_inout">
+ <return-type type="gint"/>
+ <parameters>
+ <parameter name="object" type="FooObject*"/>
+ <parameter name="inoutarg" type="int*" direction="in-out"/>
+ </parameters>
+ </method>
+ <method name="inout2" symbol="foo_object_inout2">
+ <return-type type="gint"/>
+ <parameters>
+ <parameter name="object" type="FooObject*"/>
+ <parameter name="inoutarg" type="int*" direction="in-out"/>
+ </parameters>
+ </method>
+ <method name="inout3" symbol="foo_object_inout3">
+ <return-type type="gint"/>
+ <parameters>
+ <parameter name="object" type="FooObject*"/>
+ <parameter name="inoutarg" type="int*" direction="in-out"/>
+ </parameters>
+ </method>
<method name="method" symbol="foo_object_method">
<return-type type="gint"/>
<parameters>
libfoo.la --output $@
check-local: Foo.gidl
- @diff -u $(srcdir)/Foo-expected.gidl Foo.gidl && echo "Foo.gidl"
+ @diff -u -U 10 $(srcdir)/Foo-expected.gidl Foo.gidl && echo "Foo.gidl"
@echo "======================="
@echo "All parser tests passed"
@echo "======================="
gint foo_object_out (FooObject *object,
int *outarg);
GObject* foo_object_create_object (FooObject *object);
+gint foo_object_inout (FooObject *object, int *inoutarg);
+gint foo_object_inout2 (FooObject *object, int *inoutarg);
+gint foo_object_inout3 (FooObject *object, int *inoutarg);
+gint foo_object_in (FooObject *object, int *inarg);
+gint foo_object_calleeowns (FooObject *object, GObject *toown);
+gint foo_object_calleesowns (FooObject *object, GObject *toown1, GObject *toown2);
struct _FooSubobject
}
+/**
+ * foo_object_method:
+ * @object: a #GObject
+ *
+ * Return value: an int
+ **/
gint
foo_object_method (FooObject *object)
{
-
+ return 1;
}
/**
* Return value: an int
*/
gint
+foo_object_in (FooObject *object, int *outarg)
+{
+ return 1;
+}
+
+/**
+ * foo_object_in:
+ * @object: a #GObject
+ *
+ * This is a test for out arguments
+ *
+ * @outarg: (in): This is an argument test
+ * Return value: an int
+ */
+gint
foo_object_out (FooObject *object, int *outarg)
{
return 1;
}
+
+/**
+ * foo_object_inout:
+ * @object: a #GObject
+ *
+ * This is a test for out arguments
+ *
+ * @inoutarg: (inout): This is an argument test
+ * Return value: an int
+ */
+gint
+foo_object_inout (FooObject *object, int *inoutarg)
+{
+ return 1;
+}
+
+/**
+ * foo_object_inout2:
+ * @object: a #GObject
+ *
+ * This is a second test for out arguments
+ *
+ * @inoutarg: (in) (out): This is an argument test
+ * Return value: an int
+ */
+gint
+foo_object_inout2 (FooObject *object, int *inoutarg)
+{
+ return 1;
+}
+
+
+/**
+ * foo_object_inout3:
+ * @object: a #GObject
+ *
+ * This is a 3th test for out arguments
+ *
+ * @inoutarg: (in-out): This is an argument test
+ * Return value: an int
+ */
+gint
+foo_object_inout3 (FooObject *object, int *inoutarg)
+{
+ return 1;
+}
+
+/**
+ * foo_object_calleeowns:
+ * @object: a #GObject
+ *
+ * This is a test for out arguments
+ *
+ * @toown: (callee-owns): a #GObject
+ * Return value: an int
+ */
+gint
+foo_object_calleeowns (FooObject *object, GObject *toown)
+{
+ return 1;
+}
+
+
+/**
+ * foo_object_calleesowns:
+ * @object: a #GObject
+ *
+ * This is a test for out arguments
+ *
+ * @toown1: (callee-owns): a #GObject
+ * @toown2: (callee-owns): a #GObject
+ * Return value: an int
+ */
+gint
+foo_object_calleesowns (FooObject *object, GObject *toown1, GObject *toown2)
+{
+ return 1;
+}
+
+
/**
* foo_object_create_object:
* @object: a #GObject
param->transfer = TRUE;
if (g_ascii_strcasecmp (stringy_data, "null-ok") == 0)
param->null_ok = TRUE;
+ if (g_ascii_strcasecmp (stringy_data, "inout") == 0) {
+ param->in = TRUE;
+ param->out = TRUE;
+ }
+ if (g_ascii_strcasecmp (stringy_data, "in-out") == 0) {
+ param->in = TRUE;
+ param->out = TRUE;
+ }
if (g_ascii_strcasecmp (stringy_data, "in") == 0)
param->in = TRUE;
if (g_ascii_strcasecmp (stringy_data, "out") == 0)
{
char *ptr = parts[1];
GString *current = NULL;
- gboolean open = FALSE;
+ gboolean open = (*ptr == '(');
current = g_string_new ("");
value = parts[2];
while (*ptr++)
{
- if (*ptr != ')')
+ if (*ptr == '(')
+ open = TRUE;
+ else if (*ptr != ')' && open)
g_string_append_c (current, *ptr);
- else if (*ptr == ')')
+ else if (*ptr == ')') {
options = g_slist_prepend (options, g_strdup (current->str));
+ open = FALSE;
+ }
}
g_string_free (current, TRUE);
}