48 lines
1.0 KiB
C
48 lines
1.0 KiB
C
#ifndef BLUELIB_CORE_STATUS_H_
|
|
#define BLUELIB_CORE_STATUS_H_
|
|
|
|
#include <blue/core/misc.h>
|
|
|
|
#define B_OK(status) ((enum b_status)((uintptr_t)(status)) == B_SUCCESS)
|
|
#define B_ERR(status) ((status) != B_SUCCESS)
|
|
|
|
typedef enum b_status {
|
|
B_SUCCESS = 0x00u,
|
|
B_ERR_NO_MEMORY,
|
|
B_ERR_OUT_OF_BOUNDS,
|
|
B_ERR_INVALID_ARGUMENT,
|
|
B_ERR_NAME_EXISTS,
|
|
B_ERR_NOT_SUPPORTED,
|
|
B_ERR_BAD_STATE,
|
|
B_ERR_NO_ENTRY,
|
|
B_ERR_NO_DATA,
|
|
B_ERR_NO_SPACE,
|
|
B_ERR_UNKNOWN_FUNCTION,
|
|
B_ERR_BAD_FORMAT,
|
|
B_ERR_IO_FAILURE,
|
|
B_ERR_IS_DIRECTORY,
|
|
B_ERR_NOT_DIRECTORY,
|
|
B_ERR_PERMISSION_DENIED,
|
|
B_ERR_BUSY,
|
|
|
|
/* blue-compress specific code */
|
|
B_ERR_COMPRESSION_FAILURE,
|
|
|
|
/* blue-object specific code */
|
|
B_ERR_TYPE_REGISTRATION_FAILURE,
|
|
B_ERR_CLASS_INIT_FAILURE,
|
|
} b_status;
|
|
|
|
typedef enum b_status_msg {
|
|
B_MSG_SUCCESS = 0,
|
|
|
|
/* blue-object specific messages */
|
|
B_MSG_TYPE_REGISTRATION_FAILURE,
|
|
B_MSG_CLASS_INIT_FAILURE,
|
|
} b_status_msg;
|
|
|
|
BLUE_API const char *b_status_to_string(b_status status);
|
|
BLUE_API const char *b_status_description(b_status status);
|
|
|
|
#endif
|