dbus/test/glib test-service-glib.xml, 1.10, 1.11 test-service-glib.c, 1.20, 1.21

Colin Walters walters at freedesktop.org
Sun Jul 10 03:52:54 EST 2005


Update of /cvs/dbus/dbus/test/glib
In directory gabe:/tmp/cvs-serv1747/test/glib

Modified Files:
	test-service-glib.xml test-service-glib.c 
Log Message:
2005-07-09  Colin Walters  <walters at verbum.org>

	* glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_CONST):
	Define.

	* glib/dbus-binding-tool-glib.c (generate_glue): Handle Const
	annotation.

	* glib/dbus-gobject.c (arg_iterate): Update to parse constval too.
	(method_dir_signature_from_object_info): Handle arg_iterate change.
	(write_interface): Ditto.
	(lookup_object_info): Don't barf if format_version is > 0.
	(invoke_object_method): Handle arg constness.

	* glib/dbus-gidl.c (struct ArgInfo): Add annotations.
	(arg_info_new): Create.
	(arg_info_unref): Destroy.
	(arg_info_get_annotations, arg_info_get_annotation) 
	(arg_info_add_annotation): New functions.

	* glib/dbus-gidl.h: Prototype them.

	* glib/dbus-gparser.c (parse_annotation): Allow annotations in
	args, disallow them in properties.
	(parse_annotation): Handle arg annotations.

	* test/glib/test-service-glib.xml: 
	* test/glib/test-service-glib.c: Update to make some methods
	const.


Index: test-service-glib.xml
===================================================================
RCS file: /cvs/dbus/dbus/test/glib/test-service-glib.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- test-service-glib.xml	9 Jul 2005 01:46:51 -0000	1.10
+++ test-service-glib.xml	9 Jul 2005 17:52:51 -0000	1.11
@@ -32,7 +32,9 @@
       <arg type="i" direction="out" />
       <arg type="u" direction="out" />
       <arg type="u" direction="out" />
-      <arg type="s" direction="out" />
+      <arg type="s" direction="out">
+	<annotation name="org.freedesktop.DBus.GLib.Const" value=""/>
+      </arg>
     </method>
 
     <method name="Stringify">
@@ -71,7 +73,9 @@
 
     <method name="Objpath">
       <arg type="o" direction="in"/>
-      <arg type="o" direction="out"/>
+      <arg type="o" direction="out">
+	<annotation name="org.freedesktop.DBus.GLib.Const" value=""/>
+      </arg>
     </method>
 
     <method name="GetObjs">

Index: test-service-glib.c
===================================================================
RCS file: /cvs/dbus/dbus/test/glib/test-service-glib.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- test-service-glib.c	9 Jul 2005 01:46:51 -0000	1.20
+++ test-service-glib.c	9 Jul 2005 17:52:51 -0000	1.21
@@ -58,14 +58,14 @@
 
 gboolean my_object_many_args (MyObject *obj, guint32 x, const char *str, double trouble, double *d_ret, char **str_ret, GError **error);
 
-gboolean my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, char **arg5, GError **error);
+gboolean my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, const char **arg5, GError **error);
 
 gboolean my_object_recursive1 (MyObject *obj, GArray *array, guint32 *len_ret, GError **error);
 gboolean my_object_recursive2 (MyObject *obj, guint32 reqlen, GArray **array, GError **error);
 
 gboolean my_object_many_stringify (MyObject *obj, GHashTable *vals, GHashTable **ret, GError **error);
 
-gboolean my_object_objpath (MyObject *obj, const char *in, char **arg1, GError **error);
+gboolean my_object_objpath (MyObject *obj, const char *in, const char **arg1, GError **error);
 
 gboolean my_object_get_objs (MyObject *obj, GPtrArray **objs, GError **error);
 
@@ -310,14 +310,14 @@
 }
 
 gboolean
-my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, char **arg5, GError **error)
+my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, const char **arg5, GError **error)
 {
   *arg0 = 42;
   *arg1 = g_strdup ("42");
   *arg2 = -67;
   *arg3 = 2;
   *arg4 = 26;
-  *arg5 = g_strdup ("hello world");
+  *arg5 = "hello world"; /* Annotation specifies as const */
   return TRUE;
 }
 
@@ -432,7 +432,7 @@
 }
 
 gboolean
-my_object_objpath (MyObject *obj, const char *incoming, char **outgoing, GError **error)
+my_object_objpath (MyObject *obj, const char *incoming, const char **outgoing, GError **error)
 {
   if (strcmp (incoming, "/org/freedesktop/DBus/Tests/MyTestObject"))
     {
@@ -442,7 +442,7 @@
 		   "invalid incoming object");
       return FALSE;
     }
-  *outgoing = g_strdup ("/org/freedesktop/DBus/Tests/MyTestObject2");
+  *outgoing = "/org/freedesktop/DBus/Tests/MyTestObject2";
   return TRUE;
 }
 



More information about the dbus-commit mailing list