CRI ADX  Last Updated: 2024-07-17 10:47 p
CriErr API

Enumerations

enum  CriError {
  CRIERR_OK = 0 , CRIERR_NG = -1 , CRIERR_INVALID_PARAMETER = -2 , CRIERR_FAILED_TO_ALLOCATE_MEMORY = -3 ,
  CRIERR_UNSAFE_FUNCTION_CALL = -4 , CRIERR_FUNCTION_NOT_IMPLEMENTED = -5 , CRIERR_LIBRARY_NOT_INITIALIZED = -6 , CRIERR_ENUM_BE_SINT32 = 0x7FFFFFFF
}
 Error codes. More...
 
enum  CriErrorNotificationLevel { CRIERR_NOTIFY_ALL = 0 , CRIERR_NOTIFY_FATAL = 1 , CRIERR_NOTIFY_ENUM_BE_SINT32 = 0x7FFFFFFF }
 Error notification level. More...
 

Functions

const CriChar8 * criErr_ConvertIdToMsg (const CriChar8 *errid)
 Convert error ID to error message. More...
 
const CriChar8 * criErr_ConvertIdToMessage (const CriChar8 *errid, CriUint32 p1, CriUint32 p2)
 Convert error ID to error message. More...
 
void criErr_SetCallback (CriErrCbFunc cbf)
 Register error callback function. More...
 
void criErr_SetErrorNotificationLevel (CriErrorNotificationLevel level)
 Change error notification level. More...
 
CriUint32 criErr_GetErrorCount (CriErrorLevel level)
 Retrieve error count. More...
 
void criErr_ResetErrorCount (CriErrorLevel level)
 Resets error count. More...
 

Detailed Description

Functions for error handling

Enumeration Type Documentation

◆ CriError

enum 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)

Function Documentation

◆ criErr_ConvertIdToMsg()

const CriChar8* criErr_ConvertIdToMsg ( const CriChar8 *  errid)

Convert error ID to error message.

Parameters
[in]erriderror ID
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]erriderror ID
[in]p1supplementary information 1
[in]p2supplementary 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;
errmsg = criErr_ConvertIdToMessage(errid, p1, p2);
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]cbferror 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;
errmsg = criErr_ConvertIdToMessage(errid, p1, p2);
printf("%s\n", errmsg);
}
void main(int ac, char *av[])
{
:
// Registers the error callback function
criErr_SetCallback(user_error_callback_func);
:
}
void criErr_SetCallback(CriErrCbFunc cbf)
Register error callback function.

◆ criErr_SetErrorNotificationLevel()

void criErr_SetErrorNotificationLevel ( CriErrorNotificationLevel  level)

Change error notification level.

Parameters
[in]levelerror 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
[in]levelerror level
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
[in]levelerror level
Returns
NONE
Explanation:
This function resets the counter for the number of error occurred.