]> git.meshlink.io Git - catta/blobdiff - avahi-common/dbus.h
* Improve and reorganise DBus error handling, see avahi-common/dbus.h
[catta] / avahi-common / dbus.h
index facd7b2f13bfbf6f71c32743623cf5661f864445..0164bdb776a785ed19237e0dd2abccfe70291ac3 100644 (file)
@@ -25,6 +25,7 @@
 /** \file dbus.h Some definitions for the DBUS interface */
 
 #include <avahi-common/cdecl.h>
+#include <dbus/dbus.h>
 
 AVAHI_C_DECL_BEGIN
 
@@ -57,6 +58,18 @@ AVAHI_C_DECL_BEGIN
 #define AVAHI_DBUS_ERR_OS "org.freedesktop.Avahi.OSError"
 #define AVAHI_DBUS_ERR_ACCESS_DENIED DBUS_ERROR_ACCESS_DENIED
 #define AVAHI_DBUS_ERR_INVALID_OPERATION "org.freedesktop.Avahi.InvalidOperationError"
+#define AVAHI_DBUS_ERR_DBUS_ERROR "org.freedesktop.Avahi.DBusError"
+#define AVAHI_DBUS_ERR_NOT_CONNECTED "org.freedesktop.Avahi.NotConnectedError"
+#define AVAHI_DBUS_ERR_NO_MEMORY "org.freedesktop.Avahi.NoMemoryError"
+#define AVAHI_DBUS_ERR_INVALID_OBJECT "org.freedesktop.Avahi.InvalidObjectError"
+#define AVAHI_DBUS_ERR_NO_DAEMON "org.freedesktop.Avahi.NoDaemonError"
+
+
+/** Convert a DBus error string into an Avahi error number */
+int avahi_error_dbus_to_number (const char *s);
+
+/** Convert an Avahi error number into a DBus error string.  Result should not be freed */
+const char * avahi_error_number_to_dbus (int error);
 
 AVAHI_C_DECL_END