2
3
4
5
6
7
8
9
10
15#include "../strings/gimbal_quark.h"
17#define GBL_ERROR_DOMAIN gblErrorDomain()
18#define GBL_ERROR_MESSAGE_SIZE 128
20#define GBL_SELF_TYPE GblError
25
26
27
28
29
30
31
38
39
40
41
42
43
44
45
46
47
56
57
58
67
68
69
76 const char* pFunction,
78 const GblErrorDomain* pDomain,
84 const char* pFunction,
86 const GblErrorDomain* pDomain,
92 const char* pFunction,
102#define GblError_raise(...)
103 GblError_raiseDefault_
(__VA_ARGS__)
104#define GblError_raiseDefault_(...)
105 GblError_raiseDefault__
(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__, GBL_NULL)
106#define GblError_raiseDefault__(file, func, line, domain, code, ...)
107 ((GblError_raise
)(file, func, line, domain, code, __VA_ARGS__))
109#define GblError_reraise()
110 ((GblError_reraise
)(__FILE__, __FUNCTION__, __LINE__))
const GblErrorDomain * gblErrorDomain(void)
Returns the builtin error domain used by GBL_RESULT.
GblBool GblError_clear(void)
Clears the current thread's pending error, returning GBL_TRUE if there was a pending error.
#define GBL_ERROR_MESSAGE_SIZE
Size of the GblError::message string.
const GblError * GblError_raise(const char *pFile, const char *pFunction, size_t line, const GblErrorDomain *pDomain, GblEnum code, const char *pFmt,...)
Raises an error on the current thread with the given domain, code, and message.
const char * GblError_string(void)
Returns the stringified version of the current thread's pending error code.
GblBool GblError_lower(GblError *pSelf)
Equivalent to GblError_clear(), except the pending error is copied into the destination buffer.
const GblError * GblError_pending(void)
Returns a pointer to the current thread's pending error or NULL.
const GblError * GblError_reraise(const char *pFile, const char *pFunction, size_t line)
Reraises the current thread's pending error, updating its source context.
const GblError * GblError_raisev(const char *pFile, const char *pFunction, size_t line, const GblErrorDomain *pDomain, GblEnum code, const char *pFmt, va_list varArgs)
Equivalent to GblError_raise(), except the additional args are passed via a va_list.
GblQuark GblError_domain(void)
Returns GblQuark of the name of the current thread's pending error domain.
uint32_t GblEnum
Standard-sized enum type, 32-bits across platforms.
uint8_t GblBool
Basic boolean type, standardized to sizeof(char)
uintptr_t GblQuark
Uniquely identifiable interned string type.
Defines a GblError category.
GblQuark name
Name of the error domain or category.
const char *(* pFnCodeString)(GblEnum code)
Returns a string describing an error code.
Low-level error structure.
GblEnum code
Actual raw error code returned.
char message[128]
Custom detailed error string.
GblSourceLocation srcLocation
C/C++ source code location.
const GblErrorDomain * pDomain
Pointer to the code's domain.