diff options
author | Andreas Schneider <asn@samba.org> | 2011-04-07 15:27:52 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-05-10 19:13:19 +0200 |
commit | b34e1768b762ae46e4fe761d9691ed09d285c9a9 (patch) | |
tree | f2d89197bebc53ecb4f0cdaea68696afd01001cf | |
parent | 2a1a6a9e637cec58d976a2b353fee6b026599f37 (diff) | |
download | samba-b34e1768b762ae46e4fe761d9691ed09d285c9a9.tar.gz |
libsmbconf: Added a sbcErrorString() function.
Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | lib/smbconf/smbconf.c | 35 | ||||
-rw-r--r-- | lib/smbconf/smbconf.h | 9 |
2 files changed, 44 insertions, 0 deletions
diff --git a/lib/smbconf/smbconf.c b/lib/smbconf/smbconf.c index 80fe9aac372..5fbf52da050 100644 --- a/lib/smbconf/smbconf.c +++ b/lib/smbconf/smbconf.c @@ -42,6 +42,41 @@ static WERROR smbconf_global_check(struct smbconf_ctx *ctx) * **********************************************************************/ +const char *sbcErrorString(sbcErr error) +{ + switch (error) { + case SBC_ERR_OK: + return "SBC_ERR_OK"; + case SBC_ERR_NOT_IMPLEMENTED: + return "SBC_ERR_NOT_IMPLEMENTED"; + case SBC_ERR_NOT_SUPPORTED: + return "SBC_ERR_NOT_SUPPORTED"; + case SBC_ERR_UNKNOWN_FAILURE: + return "SBC_ERR_UNKNOWN_FAILURE"; + case SBC_ERR_NOMEM: + return "SBC_ERR_NOMEM"; + case SBC_ERR_INVALID_PARAM: + return "SBC_ERR_INVALID_PARAM"; + case SBC_ERR_BADFILE: + return "SBC_ERR_BADFILE"; + case SBC_ERR_NO_SUCH_SERVICE: + return "SBC_ERR_NO_SUCH_SERVICE"; + case SBC_ERR_IO_FAILURE: + return "SBC_ERR_IO_FAILURE"; + case SBC_ERR_CAN_NOT_COMPLETE: + return "SBC_ERR_CAN_NOT_COMPLETE"; + case SBC_ERR_NO_MORE_ITEMS: + return "SBC_ERR_NO_MORE_ITEMS"; + case SBC_ERR_FILE_EXISTS: + return "SBC_ERR_FILE_EXISTS"; + case SBC_ERR_ACCESS_DENIED: + return "SBC_ERR_ACCESS_DENIED"; + } + + return "unknown sbcErr value"; +} + + /** * Tell whether the backend requires messaging to be set up * for the backend to work correctly. diff --git a/lib/smbconf/smbconf.h b/lib/smbconf/smbconf.h index dc640d075b6..11e971b5bad 100644 --- a/lib/smbconf/smbconf.h +++ b/lib/smbconf/smbconf.h @@ -57,6 +57,15 @@ struct smbconf_service { char **param_values; }; +/** + * @brief Translate an error value into a string + * + * @param error + * + * @return a pointer to a static string + **/ +const char *sbcErrorString(sbcErr error); + /* * the smbconf API functions */ |