X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=error.h;h=59d0321f746545479f60a615e8ef8691c8105c84;hp=ba18c6dcf81382f4fb4bccaa090704857c6cc9fe;hb=b6100d88b5a03e824991b4a5bfd90b0e951e8d2b;hpb=b2e6a24448a9e49e0766ab4f32163580eeff469e diff --git a/error.h b/error.h index ba18c6dc..59d0321f 100644 --- a/error.h +++ b/error.h @@ -6,8 +6,6 @@ /** \file error.h List of error messages for all subsystems. */ -#include - /** \cond */ /* List of all subsystems that use paraslash's error facility. */ @@ -240,6 +238,7 @@ extern const char **para_errlist[]; #define STAT_ERRORS \ PARA_ERROR(TOO_MANY_CLIENTS, "maximal number of stat clients exceeded"), \ PARA_ERROR(UNKNOWN_STAT_ITEM, "status item not recognized"), \ + PARA_ERROR(STAT_ITEM_PARSE, "failed to parse status item"), \ #define OGGDEC_FILTER_ERRORS \ @@ -278,6 +277,7 @@ extern const char **para_errlist[]; PARA_ERROR(STRTOLL, "unknown strtoll error"), \ PARA_ERROR(ATOI_NO_DIGITS, "no digits found in string"), \ PARA_ERROR(ATOI_JUNK_AT_END, "further characters after number"), \ + PARA_ERROR(SIZE_PREFIX, "bad size prefix") \ #define EXEC_ERRORS \ @@ -331,14 +331,15 @@ extern const char **para_errlist[]; #define COMMAND_ERRORS \ PARA_ERROR(COMMAND_SYNTAX, "syntax error in command"), \ - PARA_ERROR(AUTH, "did not receive auth request"), \ + PARA_ERROR(AUTH_REQUEST, "did not receive auth request"), \ PARA_ERROR(NO_AUDIO_FILE, "no audio file"), \ PARA_ERROR(BAD_CMD, "invalid command"), \ PARA_ERROR(PERM, "permission denied"), \ PARA_ERROR(LOCK, "lock error"), \ PARA_ERROR(SENDER_CMD, "command not supported by this sender"), \ PARA_ERROR(SERVER_CRASH, "para_server crashed -- can not live without it"), \ - PARA_ERROR(BAD_USER, "you don't exist. Go away."), \ + PARA_ERROR(BAD_USER, "auth request for invalid user"), \ + PARA_ERROR(BAD_AUTH, "authentication failure"), \ #define DCCP_RECV_ERRORS \ @@ -483,8 +484,10 @@ _static_inline_ int is_errno(int num, int _errno) _static_inline_ const char *para_strerror(int num) { assert(num > 0); +#ifdef _OSL_H if (IS_OSL_ERROR(num)) return osl_strerror(num & ((1 << OSL_ERROR_BIT) - 1)); +#endif if (IS_SYSTEM_ERROR(num)) return strerror(num & ((1 << SYSTEM_ERROR_BIT) - 1)); return para_errlist[ERRNUM_TO_SS(num)][ERRNUM_TO_INDEX(num)]; @@ -496,19 +499,18 @@ _static_inline_ const char *para_strerror(int num) * \param ret The return value of an osl library function. * * This should be used for all calls to osl functions that return an osl error - * code. It changes the return value to \p -E_OSL appropriately so that it can - * be used for printing the correct error message. + * code. It changes the return value appropriately so that it can be used for + * printing the correct error message vi para_strerror(). * - * \return \a ret if \a ret >= 0, \p -E_OSL otherwise. + * \return \a ret if \a ret >= 0, a paraslash error code otherwise. */ _static_inline_ int osl(int ret) { if (ret >= 0) return ret; - return OSL_ERRNO_TO_PARA_ERROR(-ret); + return -OSL_ERRNO_TO_PARA_ERROR(-ret); } - /** * Define the error list for one subsystem. #