📄 error.h
字号:
/******************************************************************************
*******************************************************************************
** **
** Copyright (c) 2006 Videon Central, Inc. **
** All rights reserved. **
** **
** The computer program contained herein contains proprietary information **
** which is the property of Videon Central, Inc. The program may be used **
** and/or copied only with the written permission of Videon Central, Inc. **
** or in accordance with the terms and conditions stipulated in the **
** agreement/contract under which the programs have been supplied. **
** **
*******************************************************************************
******************************************************************************/
/**
* @file error.h
*
* $Revision: 1.11 $
*
* Common error handling
*
*/
#ifndef __ERROR_H
#define __ERROR_H
#ifdef __cplusplus
extern "C" {
#endif
#include "vcitypes.h"
#include "osapi.h"
typedef enum
{
VDVD_SUCCESS =0,
VDVD_ABORT =1,
VDVD_ERROR_TIMEOUT = OS_TIMEOUT,
VDVD_ERROR_PLATFORM_FAILED =3,
VDVD_ERROR_NOT_IMPLEMENTED,
VDVD_ERROR_NOT_ENOUGH_MEMORY,
VDVD_ERROR_INVALID_PARAMETER,
VDVD_ERROR_END_OF_STREAM,
VDVD_ERROR_UNABLE_TO_CREATE_OBJECT,
VDVD_ERROR_OBJECT_NOT_FOUND,
VDVD_ERROR_OBJECT_HAS_INVALID_STATE,
VDVD_ERROR_OBJECT_BUSY,
VDVD_ERROR_OBJECT_FAILED,
VDVD_ERROR_ASSERTION_FAILED
/* ADD NEW ERROR CODES TO ConvertErrorToString */
} VDVD_ERROR;
#define VDVD_IS_ERROR( error ) ( (error) != VDVD_SUCCESS )
#ifdef NDEBUG
#define VDVD_RAISE_ERROR( error ) { VDVD_ERROR errorLocalCopy=(error); if ( errorLocalCopy != VDVD_SUCCESS ) { return ( errorLocalCopy ); } }
#define VDVD_ASSERT_ERROR( condition, error ) { VDVD_ERROR errorLocalCopy=(error); if ( condition ) { return ( errorLocalCopy ); } }
#define VDVD_ASSERT_REPORT_ERROR( condition, error ) { VDVD_ERROR errorLocalCopy=(error); if ( condition ) { } }
#define VDVD_REPORT_ERROR( error ) { VDVD_ERROR errorLocalCopy=(error); if ( VDVD_IS_ERROR(errorLocalCopy) ) { } }
#else
#define VDVD_RAISE_ERROR( error ) { VDVD_ERROR errorLocalCopy=(error); if ( (errorLocalCopy) != VDVD_SUCCESS ) { DisplayError( __FILE__,__FUNCTION__,__LINE__, errorLocalCopy ); return ( errorLocalCopy ); } }
#define VDVD_ASSERT_ERROR( condition, error ) { VDVD_ERROR errorLocalCopy=(error); if ( condition ) { DisplayError( __FILE__,__FUNCTION__,__LINE__, errorLocalCopy ); return ( errorLocalCopy ); } }
#define VDVD_ASSERT_REPORT_ERROR( condition, error ) { VDVD_ERROR errorLocalCopy=(error); if ( condition ) { DisplayError( __FILE__,__FUNCTION__,__LINE__, errorLocalCopy ); } }
#define VDVD_REPORT_ERROR( error ) { VDVD_ERROR errorLocalCopy=(error); if ( VDVD_IS_ERROR(errorLocalCopy) ) { DisplayError( __FILE__,__FUNCTION__,__LINE__, errorLocalCopy ); } }
#endif
const char* ConvertErrorToString ( VDVD_ERROR errorCode );
void DisplayError ( const char* filename, const char* function, uint32 sourceLineNumber, VDVD_ERROR vdvdErrorCode );
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -