diff options
| author | Lennart Poettering <lennart@poettering.net> | 2005-09-25 19:57:10 +0000 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2005-09-25 19:57:10 +0000 | 
| commit | 1a0fb70d743f900859d9278c6ae01cfc2a993dad (patch) | |
| tree | eea384668e5a24ffd48c73f6c06617145dddae3d | |
| parent | 9afe364e3fbe042d0de1988426cf60c91a4d32ac (diff) | |
add a bunch of new errors codes
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@604 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
| -rw-r--r-- | avahi-common/dbus.c | 7 | ||||
| -rw-r--r-- | avahi-common/dbus.h | 5 | ||||
| -rw-r--r-- | avahi-common/error.c | 9 | ||||
| -rw-r--r-- | avahi-common/error.h | 7 | 
4 files changed, 26 insertions, 2 deletions
diff --git a/avahi-common/dbus.c b/avahi-common/dbus.c index e2b3a3f..28428ed 100644 --- a/avahi-common/dbus.c +++ b/avahi-common/dbus.c @@ -57,7 +57,12 @@ static const char * const table[- AVAHI_ERR_MAX] = {      AVAHI_DBUS_ERR_NOT_CONNECTED,      AVAHI_DBUS_ERR_NO_MEMORY,      AVAHI_DBUS_ERR_INVALID_OBJECT, -    AVAHI_DBUS_ERR_NO_DAEMON +    AVAHI_DBUS_ERR_NO_DAEMON, +    AVAHI_DBUS_ERR_INVALID_INTERFACE, +    AVAHI_DBUS_ERR_INVALID_PROTOCOL, +    AVAHI_DBUS_ERR_INVALID_FLAGS, +    AVAHI_DBUS_ERR_NOT_FOUND, +    AVAHI_DBUS_ERR_INVALID_CONFIG  };  int avahi_error_dbus_to_number(const char *s) { diff --git a/avahi-common/dbus.h b/avahi-common/dbus.h index cdfef4d..cd90af1 100644 --- a/avahi-common/dbus.h +++ b/avahi-common/dbus.h @@ -68,6 +68,11 @@ AVAHI_C_DECL_BEGIN  #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" +#define AVAHI_DBUS_ERR_INVALID_INTERFACE "org.freedesktop.Avahi.InvalidInterfaceError" +#define AVAHI_DBUS_ERR_INVALID_PROTOCOL "org.freedesktop.Avahi.InvalidInterfaceProtocol" +#define AVAHI_DBUS_ERR_INVALID_FLAGS "org.freedesktop.Avahi.InvalidFlags" +#define AVAHI_DBUS_ERR_NOT_FOUND "org.freedesktop.Avahi.NotFound" +#define AVAHI_DBUS_ERR_INVALID_CONFIG "org.freedesktop.Avahi.InvalidConfiguration"  /** Convert a DBus error string into an Avahi error number */  int avahi_error_dbus_to_number(const char *s); diff --git a/avahi-common/error.c b/avahi-common/error.c index 67a5701..73f13d2 100644 --- a/avahi-common/error.c +++ b/avahi-common/error.c @@ -19,6 +19,10 @@    USA.   ***/ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +  #include "error.h"  const char *avahi_strerror(int error) { @@ -51,6 +55,11 @@ const char *avahi_strerror(int error) {          "Memory exhausted",          "The object passed in was not valid",          "Daemon not running", +        "Invalid interface index", +        "Invalid protocol specification", +        "Invalid flags", +        "Not found", +        "Invalid configuration"      };      if (-error < 0 || -error >= -AVAHI_ERR_MAX) diff --git a/avahi-common/error.h b/avahi-common/error.h index f8d6c35..2b06c5a 100644 --- a/avahi-common/error.h +++ b/avahi-common/error.h @@ -59,6 +59,11 @@ enum {      AVAHI_ERR_NO_MEMORY = -24,             /**< Memory exhausted */      AVAHI_ERR_INVALID_OBJECT = -25,        /**< The object passed to this function was invalid */      AVAHI_ERR_NO_DAEMON = -26,             /**< Daemon not running */ +    AVAHI_ERR_INVALID_INTERFACE = -27,     /**< Invalid interface */ +    AVAHI_ERR_INVALID_PROTOCOL = -28,      /**< Invalid protocol */ +    AVAHI_ERR_INVALID_FLAGS = -29,         /**< Invalid flags */ +    AVAHI_ERR_NOT_FOUND = -30,             /**< Not found */ +    AVAHI_ERR_INVALID_CONFIG = -31,        /**< Configuration error */      /****       ****    IF YOU ADD A NEW ERROR CODE HERE, PLEASE DON'T FORGET TO ADD @@ -68,7 +73,7 @@ enum {       ****    Also remember to update the MAX value below.       ****/ -    AVAHI_ERR_MAX = -27 +    AVAHI_ERR_MAX = -32  };  /** Return a human readable error string for the specified error code */  | 
