Files
bluelib/core/include/blue/core/status.h

48 lines
1.0 KiB
C
Raw Normal View History

2024-08-03 07:54:28 +01:00
#ifndef BLUELIB_CORE_STATUS_H_
#define BLUELIB_CORE_STATUS_H_
2024-11-14 16:56:12 +00:00
#include <blue/core/misc.h>
2025-07-28 22:13:41 +01:00
#define B_OK(status) ((enum b_status)((uintptr_t)(status)) == B_SUCCESS)
2024-08-03 07:54:28 +01:00
#define B_ERR(status) ((status) != B_SUCCESS)
2024-11-22 22:29:05 +00:00
typedef enum b_status {
2024-08-03 07:54:28 +01:00
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,
2025-07-28 22:13:41 +01:00
B_ERR_NO_SPACE,
2024-08-03 07:54:28 +01:00
B_ERR_UNKNOWN_FUNCTION,
B_ERR_BAD_FORMAT,
2025-02-12 22:10:57 +00:00
B_ERR_IO_FAILURE,
B_ERR_IS_DIRECTORY,
B_ERR_NOT_DIRECTORY,
B_ERR_PERMISSION_DENIED,
2025-07-28 22:13:41 +01:00
B_ERR_BUSY,
/* blue-compress specific code */
2025-07-28 22:13:41 +01:00
B_ERR_COMPRESSION_FAILURE,
/* blue-object specific code */
B_ERR_TYPE_REGISTRATION_FAILURE,
B_ERR_CLASS_INIT_FAILURE,
2024-08-03 07:54:28 +01:00
} 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;
2024-11-14 16:56:12 +00:00
BLUE_API const char *b_status_to_string(b_status status);
2025-07-28 22:13:41 +01:00
BLUE_API const char *b_status_description(b_status status);
2024-08-03 07:54:28 +01:00
#endif