Canonical status codes and failure callback hooks.
More...
|
| | Status codes |
| | Well-defined error and success codes used by LibJuno.
|
| |
|
| #define | JUNO_FAIL_MESSAGE_LEN 256 |
| | Recommended maximum length for failure messages.
|
| |
| #define | JUNO_FAIL(tStatus, pfcnFailureHandler, pvFailureUserData, pcMessage) if(pfcnFailureHandler){pfcnFailureHandler(tStatus, pcMessage, pvFailureUserData);} |
| | Invoke a failure handler if provided.
|
| |
| #define | JUNO_FAIL_MODULE(tStatus, ptMod, pcMessage) if(ptMod && ptMod->JUNO_MODULE_SUPER.JUNO_FAILURE_HANDLER){ptMod->JUNO_MODULE_SUPER.JUNO_FAILURE_HANDLER(tStatus, pcMessage, ptMod->JUNO_MODULE_SUPER.JUNO_FAILURE_USER_DATA);} |
| | Invoke a module instance's failure handler if available.
|
| |
| #define | JUNO_FAIL_ROOT(tStatus, ptMod, pcMessage) if(ptMod && ptMod->JUNO_FAILURE_HANDLER){ptMod->JUNO_FAILURE_HANDLER(tStatus, pcMessage, ptMod->JUNO_FAILURE_USER_DATA);} |
| | Invoke a module root's failure handler if available.
|
| |
Canonical status codes and failure callback hooks.
LibJuno uses a single 32-bit integer type for status propagation. Zero indicates success; non-zero values indicate specific failure conditions enumerated by the constants in this module. Optional failure callbacks let applications log or collect diagnostics without affecting control flow.
◆ JUNO_FAIL
| #define JUNO_FAIL |
( |
|
tStatus, |
|
|
|
pfcnFailureHandler, |
|
|
|
pvFailureUserData, |
|
|
|
pcMessage |
|
) |
| if(pfcnFailureHandler){pfcnFailureHandler(tStatus, pcMessage, pvFailureUserData);} |
Invoke a failure handler if provided.
- Parameters
-
| tStatus | Status value to report. |
| pfcnFailureHandler | Failure handler function pointer (nullable). |
| pvFailureUserData | Opaque user data pointer passed to the handler. |
| pcMessage | Optional message describing the failure. |
- Note
- This macro does not alter control flow; callers should still return or handle the error as appropriate.
◆ JUNO_FAIL_MESSAGE_LEN
| #define JUNO_FAIL_MESSAGE_LEN 256 |
Recommended maximum length for failure messages.
◆ JUNO_FAIL_MODULE
Invoke a module instance's failure handler if available.
- Parameters
-
| tStatus | Status value to report. |
| ptMod | Pointer to a module instance (may be NULL). |
| pcMessage | Optional message describing the failure. |
- Warning
- This macro expects the pointed-to object to expose a
JUNO_MODULE_SUPER member with JUNO_FAILURE_HANDLER and JUNO_FAILURE_USER_DATA fields as defined by the module system. Use only with LibJuno module types.
◆ JUNO_FAIL_ROOT
Invoke a module root's failure handler if available.
- Parameters
-
| tStatus | Status value to report. |
| ptMod | Pointer to a module root (may be NULL). |
| pcMessage | Optional message describing the failure. |
◆ JUNO_FAILURE_HANDLER_T
Failure handler callback signature.
- Parameters
-
| tStatus | Status code for the failure condition. |
| pcCustomMessage | Optional, human-readable message with context (may be NULL). |
| pvUserData | Opaque user data pointer supplied by the caller (may be NULL). |
◆ JUNO_STATUS_T
Canonical status type for LibJuno functions.
◆ JUNO_USER_DATA_T
Opaque user data type for failure callbacks.