Functions for error handling
◆ CriError
Error codes.
Enumerator |
---|
CRIERR_OK | Succeeded
|
CRIERR_NG | Error occurred
|
CRIERR_INVALID_PARAMETER | Invalid argument
|
CRIERR_FAILED_TO_ALLOCATE_MEMORY | Failed to allocate memory
|
CRIERR_UNSAFE_FUNCTION_CALL | Parallel execution of thread-unsafe function
|
CRIERR_FUNCTION_NOT_IMPLEMENTED | Function not implemented
|
CRIERR_LIBRARY_NOT_INITIALIZED | Library not initialized
|
◆ CriErrorNotificationLevel
Error notification level.
Enumerator |
---|
CRIERR_NOTIFY_ALL | Report all errors
|
CRIERR_NOTIFY_FATAL | Report error (Disregards warning)
|
◆ criErr_ConvertIdToMsg()
const CriChar8* criErr_ConvertIdToMsg |
( |
const CriChar8 * |
errid | ) |
|
Convert error ID to error message.
- Parameters
-
- Returns
- error message
- Description:
- This function converts an error ID into a detailed error message.
- Attention
- This function is an obsolete one.
Use the criErr_ConvertIdToMessage function instead.
- See also
- criErr_ConvertIdToMessage
◆ criErr_ConvertIdToMessage()
const CriChar8* criErr_ConvertIdToMessage |
( |
const CriChar8 * |
errid, |
|
|
CriUint32 |
p1, |
|
|
CriUint32 |
p2 |
|
) |
| |
Convert error ID to error message.
- Parameters
-
[in] | errid | error ID |
[in] | p1 | supplementary information 1 |
[in] | p2 | supplementary information 2 |
- Returns
- error message
- Description:
- This function converts error ID to detailed error message.
- Example:
void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray);
{
const CriChar8 *errmsg;
printf("%s\n", errmsg);
}
const CriChar8 * criErr_ConvertIdToMessage(const CriChar8 *errid, CriUint32 p1, CriUint32 p2)
Convert error ID to error message.
◆ criErr_SetCallback()
void criErr_SetCallback |
( |
CriErrCbFunc |
cbf | ) |
|
Register error callback function.
- Parameters
-
[in] | cbf | error callback function |
- Returns
- NONE
- Description:
- This function registers an error callback function.
The registered function is called if an error occurs within the CRI middleware library.
Only one error callback function can be registered at a time.
If this function is called again after being registered, the current registration is overwritten.
- Example:
void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray);
{
const CriChar8 *errmsg;
printf("%s\n", errmsg);
}
void main(int ac, char *av[])
{
:
:
}
void criErr_SetCallback(CriErrCbFunc cbf)
Register error callback function.
◆ criErr_SetErrorNotificationLevel()
Change error notification level.
- Parameters
-
[in] | level | error notification level |
- Returns
- NONE
- Description:
- This function changes the level of error information that is notified to the error callback.
◆ criErr_GetErrorCount()
CriUint32 criErr_GetErrorCount |
( |
CriErrorLevel |
level | ) |
|
Retrieve error count.
- Parameters
-
- Returns
- number of errors occurred
- Description:
- This function retrieves the number of errors occurred.
◆ criErr_ResetErrorCount()
void criErr_ResetErrorCount |
( |
CriErrorLevel |
level | ) |
|
Resets error count.
- Parameters
-
- Returns
- NONE
- Explanation:
- This function resets the counter for the number of error occurred.