|
CX Framework
Cross-platform C utility framework
|
Enumerations | |
| enum | CX_ERROR { CX_Success = 0 , CX_Unspecified , CX_InvalidArgument , CX_AccessDenied , CX_FileNotFound , CX_AlreadyExists , CX_IsDirectory , CX_ReadOnly , CX_Range } |
Functions | |
| const char * | cxErrMsg (int err) |
Variables | |
| _Thread_local int | cxerr |
Thread-local error code system for functions that cannot return error values.
The cxerr facility provides a thread-safe error reporting mechanism similar to the standard errno, but integrated into the CX framework. Functions that need to report errors but cannot return an error code (e.g., functions returning pointers or having other return value semantics) can set cxerr to indicate the reason for failure.
Key characteristics:
CX_Success) indicates successTypical usage pattern:
Functions should document when they set cxerr on failure.
| enum CX_ERROR |
Standard CX error codes
Error codes used throughout the CX framework. Functions set cxerr to one of these values to indicate specific error conditions.
| const char * cxErrMsg | ( | int | err | ) |
Get human-readable error message for an error code
| err | Error code from CX_ERROR enum |
Returns a descriptive message for the given error code. Useful for logging or displaying error information to users.
|
extern |
Thread-local error code
Set by functions to indicate error conditions. Check this variable after calling functions that document cxerr usage. Always CX_Success (0) when no error occurred.