diff src/dbus-server.h @ 13955:2d6f7ac4b6f2

[gaim-migrate @ 16503] Get rid of an assertion failure when trying to load our D-BUS example plugin if the D-BUS subsystem is not initialized for whatever reason. Not only that, the plugin gracefully fails to load and prints an error message. These error messages could be improved. If you're familiar with how D-BUS works then go for it. Also, do we need to be uninitializing any of the D-BUS stuff? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 17 Jul 2006 05:50:28 +0000
parents a539caf502b0
children f61428cc4019
line wrap: on
line diff
--- a/src/dbus-server.h	Mon Jul 17 04:33:32 2006 +0000
+++ b/src/dbus-server.h	Mon Jul 17 05:50:28 2006 +0000
@@ -135,13 +135,19 @@
 				GaimValue **values, va_list vargs);
 
 /**
- * Starts the gaim DBUS server.  It is responsible for handling DBUS
- * requests from other applications.
+ * Returns whether Gaim's D-BUS subsystem is up and running.  If it's
+ * NOT running then gaim_dbus_dispatch_init() failed for some reason,
+ * and a message should have been gaim_debug_error()'ed.
+ *
+ * This function should be called by any DBUS plugin before trying
+ * to use the DBUS API.  See plugins/dbus-example.c for usage.
  *
- * @return TRUE if successful, FALSE otherwise.
+ * @return If the D-BUS subsystem started with no problems then this
+ *         will return NULL and everything will be hunky dory.  If
+ *         there was an error initializing the D-BUS subsystem then
+ *         this will return an error message explaining why.
  */
-gboolean gaim_dbus_init(void);
-
+const char *gaim_dbus_get_init_error(void);
 
 /**
  * Returns the dbus subsystem handle.
@@ -151,6 +157,17 @@
 void *gaim_dbus_get_handle(void);
 
 /**
+ * Starts Gaim's D-BUS server.  It is responsible for handling DBUS
+ * requests from other applications.
+ */
+void gaim_dbus_init(void);
+
+/**
+ * Uninitializes Gaim's D-BUS server.
+ */
+void gaim_dbus_uninit(void);
+
+/**
 
  Macro #DBUS_EXPORT expands to nothing.  It is used to indicate to the
  dbus-analize-functions.py script that the given function should be