paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Macros | Functions
error.h File Reference

List of error codes and messages. More...

Macros

#define SYSTEM_ERROR_BIT   30
 para_error More...
 
#define OSL_ERROR_BIT   29
 Like SYSTEM_ERROR_BIT, but for errors from the osl library. More...
 
#define LLS_ERROR_BIT   28
 Like SYSTEM_ERROR_BIT, but for errors from the lopsub library. More...
 
#define IS_SYSTEM_ERROR(num)   (!!((num) & (1 << SYSTEM_ERROR_BIT)))
 Check whether the system error bit is set. More...
 
#define IS_OSL_ERROR(num)   (!!((num) & (1 << OSL_ERROR_BIT)))
 Check whether the osl error bit is set. More...
 
#define IS_LLS_ERROR(num)   (!!((num) & (1 << LLS_ERROR_BIT)))
 Check whether the lopsub error bit is set. More...
 
#define ERRNO_TO_PARA_ERROR(num)   ((num) | (1 << SYSTEM_ERROR_BIT))
 Set the system error bit for the given number. More...
 
#define OSL_ERRNO_TO_PARA_ERROR(num)   ((num) | (1 << OSL_ERROR_BIT))
 Set the osl error bit for the given number. More...
 
#define LLS_ERRNO_TO_PARA_ERROR(num)   ((num) | (1 << LLS_ERROR_BIT))
 Set the lopsub error bit for the error code. More...
 

Functions

_static_inline_ const char * para_strerror (int num)
 Paraslash's version of strerror(3). More...
 
_static_inline_ int osl (int ret)
 Wrapper for osl library calls. More...
 
_static_inline_ int lls (int ret)
 Wrapper for lopsub library calls. More...
 

Detailed Description

List of error codes and messages.

Macro Definition Documentation

◆ SYSTEM_ERROR_BIT

#define SYSTEM_ERROR_BIT   30

para_error

This bit indicates whether a number is considered a system error number If yes, the system errno is just the result of clearing this bit from the given number.

◆ OSL_ERROR_BIT

#define OSL_ERROR_BIT   29

Like SYSTEM_ERROR_BIT, but for errors from the osl library.

◆ LLS_ERROR_BIT

#define LLS_ERROR_BIT   28

Like SYSTEM_ERROR_BIT, but for errors from the lopsub library.

◆ IS_SYSTEM_ERROR

#define IS_SYSTEM_ERROR (   num)    (!!((num) & (1 << SYSTEM_ERROR_BIT)))

Check whether the system error bit is set.

◆ IS_OSL_ERROR

#define IS_OSL_ERROR (   num)    (!!((num) & (1 << OSL_ERROR_BIT)))

Check whether the osl error bit is set.

◆ IS_LLS_ERROR

#define IS_LLS_ERROR (   num)    (!!((num) & (1 << LLS_ERROR_BIT)))

Check whether the lopsub error bit is set.

◆ ERRNO_TO_PARA_ERROR

#define ERRNO_TO_PARA_ERROR (   num)    ((num) | (1 << SYSTEM_ERROR_BIT))

Set the system error bit for the given number.

◆ OSL_ERRNO_TO_PARA_ERROR

#define OSL_ERRNO_TO_PARA_ERROR (   num)    ((num) | (1 << OSL_ERROR_BIT))

Set the osl error bit for the given number.

◆ LLS_ERRNO_TO_PARA_ERROR

#define LLS_ERRNO_TO_PARA_ERROR (   num)    ((num) | (1 << LLS_ERROR_BIT))

Set the lopsub error bit for the error code.

Function Documentation

◆ para_strerror()

_static_inline_ const char* para_strerror ( int  num)

Paraslash's version of strerror(3).

Parameters
numThe error number.
Returns
The error text of num.

References IS_OSL_ERROR, LLS_ERROR_BIT, OSL_ERROR_BIT, and SYSTEM_ERROR_BIT.

Referenced by afs_error(), check_receiver_arg(), generic_com_on(), send_strerror(), task_notify(), and task_reap().

◆ osl()

_static_inline_ int osl ( int  ret)

Wrapper for osl library calls.

Parameters
retThe 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 appropriately so that it can be used for printing the correct error message with para_strerror().

Returns
ret if ret >= 0, a paraslash error code otherwise.

References OSL_ERRNO_TO_PARA_ERROR.

Referenced by aft_get_row_of_path(), audio_file_loop(), for_each_matching_row(), get_afhi_of_row(), get_attribute_bitnum_by_name(), get_audio_file_path_of_row(), mood_check_callback(), playlist_check_callback(), score_get_best(), score_loop(), score_open(), and score_update().

◆ lls()

_static_inline_ int lls ( int  ret)

Wrapper for lopsub library calls.

Parameters
retSee osl().
Returns
See osl().

References LLS_ERRNO_TO_PARA_ERROR.

Referenced by check_receiver_arg(), filter_setup(), and main().