dbus/dbus make-dbus-glib-error-enum.sh, 1.2, 1.3 dbus-glib.h, 1.14, 1.15

Colin Walters walters at freedesktop.org
Sun Jun 26 10:02:11 PDT 2005


Update of /cvs/dbus/dbus/dbus
In directory gabe:/tmp/cvs-serv5612/dbus

Modified Files:
	make-dbus-glib-error-enum.sh dbus-glib.h 
Log Message:
2005-06-26  Colin Walters  <walters at verbum.org>

	* glib/dbus-glib.c (dbus_set_g_error): Delete.
	(dbus_g_error_set): New public function from its ashes; used by
	both service-side method implementation and GLib bindings
	internals.
	(dbus_g_error_has_name, dbus_g_error_get_name): New function.
	(_dbus_glib_test): Add some tests.

	* test/glib/test-dbus-glib.c (main): Test dbus_g_error_has_name.

	* test/glib/test-service-glib.c (my_object_throw_error): Use
	dbus_g_error_set.

	* glib/dbus-gobject.c (gerror_to_dbus_error_message): Handle
	errors thrown by dbus_g_error_set.

	* glib/dbus-gmain.c (dbus_g_bus_get): Change to dbus_g_error_set.

	* glib/dbus-gparser.c (validate_signature): Ditto.

	* glib/dbus-gproxy.c (dbus_g_proxy_new_for_name_owner) 
	(dbus_g_proxy_end_call_internal): Ditto.

	* glib/Makefile.am: Generate dbus-glib-error-switch.h, which
	converts DBUS_ERROR_x to DBUS_GERROR_x.
	(libdbus_glib_1_la_SOURCES, BUILT_SOURCES, CLEANFILES): Add it.

	* doc/TODO: Remove error TODO.

	* doc/dbus-tutorial.xml: Update with documentation about error
	handling.

	* dbus/make-dbus-glib-error-enum.sh: Tighten up regexp to make
	sure we only change DBUS_ERROR to DBUS_GERROR, not all ERROR to
	GERROR.  Also add DBUS_GERROR_REMOTE_EXCEPTION.


Index: make-dbus-glib-error-enum.sh
===================================================================
RCS file: /cvs/dbus/dbus/dbus/make-dbus-glib-error-enum.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- make-dbus-glib-error-enum.sh	21 Dec 2004 10:51:46 -0000	1.2
+++ make-dbus-glib-error-enum.sh	26 Jun 2005 17:02:09 -0000	1.3
@@ -11,11 +11,12 @@
 }
 
 cat $SRC | grep '#define DBUS_ERROR' | sed -e 's/#define //g' | \
-  sed -e 's/".*//g' | sed -e 's/_ERROR/_GERROR/g' | sed -e 's/ *$/,/g' > $DEST.tmp
+  sed -e 's/".*//g' | sed -e 's/DBUS_ERROR/DBUS_GERROR/g' | sed -e 's/ *$/,/g' > $DEST.tmp
 
 if ! test -s $DEST.tmp ; then
     die "$DEST.tmp is empty, something went wrong, see any preceding error message"
 fi
+echo "DBUS_GERROR_REMOTE_EXCEPTION" >> $DEST.tmp
 
 echo "#ifndef DBUS_INSIDE_DBUS_GLIB_H" >> $DEST.tmp
 echo '#error "' "$DEST" 'may only be included by dbus-glib.h"' >> $DEST.tmp

Index: dbus-glib.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-glib.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- dbus-glib.h	21 Jun 2005 00:30:20 -0000	1.14
+++ dbus-glib.h	26 Jun 2005 17:02:09 -0000	1.15
@@ -81,6 +81,13 @@
 #include <dbus/dbus-glib-error-enum.h>    
 } DBusGError;
 
+void             dbus_g_error_set         (GError     **error,
+					   const char  *name,
+					   const char  *msg);
+gboolean         dbus_g_error_has_name    (GError      *error,
+					   const char  *name);
+const char *     dbus_g_error_get_name    (GError      *error);
+
 void             dbus_g_thread_init (void);
 DBusGConnection* dbus_g_bus_get     (DBusBusType   type,
                                      GError      **error);



More information about the dbus-commit mailing list