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

枚举

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 更多...
 
enum  CriErrorNotificationLevel { CRIERR_NOTIFY_ALL = 0 , CRIERR_NOTIFY_FATAL = 1 , CRIERR_NOTIFY_ENUM_BE_SINT32 = 0x7FFFFFFF }
 Error notification level 更多...
 

函数

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

详细描述






















Functions for error handling

枚举类型说明

◆ CriError

enum CriError

Error codes

枚举值
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

枚举值
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

参数
[in]erriderror ID
返回
error message
Description:
This function converts an error ID into a detailed error message.
注意
This function is an obsolete one.
Use the criErr_ConvertIdToMessage function instead.
参见
criErr_ConvertIdToMessage

◆ criErr_ConvertIdToMessage()

const CriChar8* criErr_ConvertIdToMessage ( const CriChar8 *  errid,
CriUint32  p1,
CriUint32  p2 
)

Convert error ID to error message

参数
[in]erriderror ID
[in]p1supplementary information 1
[in]p2supplementary information 2
返回
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

参数
[in]cbferror callback function
返回
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

参数
[in]levelerror notification level
返回
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

参数
[in]levelerror level
返回
number of errors occurred
Description:
This function retrieves the number of errors occurred.

◆ criErr_ResetErrorCount()

void criErr_ResetErrorCount ( CriErrorLevel  level)

Resets error count

参数
[in]levelerror level
返回
NONE
Explanation:
This function resets the counter for the number of error occurred.