/** \file error.h List of error messages for all subsystems. */
-#include <osl.h>
-
/** \cond */
/* List of all subsystems that use paraslash's error facility. */
#define MOOD_ERRORS \
- PARA_ERROR(MOOD_SYNTAX, "mood syntax error"), \
PARA_ERROR(NO_MOOD, "no mood available"), \
- PARA_ERROR(NOT_ADMISSIBLE, "file is not admissible"), \
PARA_ERROR(DUMMY_ROW, "attempted to access blob dummy object"), \
+#define MM_ERRORS \
+ PARA_ERROR(MOOD_SYNTAX, "mood syntax error"), \
+
+
#define ATTRIBUTE_ERRORS \
PARA_ERROR(ATTR_SYNTAX, "attribute syntax error"), \
PARA_ERROR(NO_ATTRIBUTES, "no attributes defined yet"), \
PARA_ERROR(AUDIOD_SYNTAX, "syntax error"), \
PARA_ERROR(UCRED_PERM, "permission denied"), \
PARA_ERROR(INVALID_AUDIOD_CMD, "invalid command"), \
+ PARA_ERROR(TOO_MANY_CLIENTS, "maximal number of stat clients exceeded"), \
+ PARA_ERROR(UNKNOWN_STAT_ITEM, "status item not recognized"), \
#define FILTER_COMMON_ERRORS \
#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 \
#define GRAB_CLIENT_ERRORS \
- PARA_ERROR(PEDANTIC_GRAB, "fd not ready and pedantic grab requested"), \
PARA_ERROR(GC_WRITE, "grab client write error"), \
PARA_ERROR(BAD_GC_SLOT, "invalid slot requested by grab client"), \
PARA_ERROR(BAD_GC_FILTER_NUM, "invalid filter number given"), \
PARA_ERROR(GC_SYNTAX, "grab client syntax error"), \
- PARA_ERROR(GC_HELP_GIVEN, ""), /* not really an error */ \
- PARA_ERROR(GC_VERSION_GIVEN, ""), /* not really an error */ \
#define MP3DEC_FILTER_ERRORS \
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"), \
+ PARA_ERROR(REGEX, "regular expression error") \
#define EXEC_ERRORS \
#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 \
_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)];
* \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.
#