⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rverror.h

📁 基于h323协议的软phone
💻 H
字号:
/***********************************************************************
Filename   : rverror.h
Description: error code definitions for all RADVISION modules
************************************************************************
      Copyright (c) 2001,2002 RADVISION Inc. and RADVISION Ltd.
************************************************************************
NOTICE:
This document contains information that is confidential and proprietary
to RADVISION Inc. and RADVISION Ltd.. No part of this document may be
reproduced in any form whatsoever without written prior approval by
RADVISION Inc. or RADVISION Ltd..

RADVISION Inc. and RADVISION Ltd. reserve the right to revise this
publication and make changes without obligation to notify any person of
such revisions or changes.
***********************************************************************/
/*$
{package:
	{name: Error}
	{superpackage: CUtils}
	{include: rverror.h}
	{description:	
		{p: This module provides macros and constants for handling error codes.}
	}
}
$*/
#ifndef RV_ERROR_H
#define RV_ERROR_H

#include "rvtypes.h"

/*$
{type:
	{name: RvStatus}
	{superpackage: Error}
	{include: rverror.h}
	{description:	
		{p: A status value (also know as an error code value).}
		{p: Each status code can be checked for three basic conditions:}
		{bulletlist:
			{item: RvStatus = RV_OK indicates no error.}
			{item: RvStatus < RV_OK indicates an error.}
			{item: RvStatus > RV_OK indicates a warning.}
		}
		{p: When a warning or an error is indicated, more information can
			be extracted from the value. Each warning or error contains
			three pieces of information which can be retrieved using the
			corresponding functions:}
		{bulletlist:
			{item: Library code: This value indicates which library the error code
					was generated in. The library codes are defined in rverror.h.}
			{item: Module code: This value indicates which module within the indicated
					library that the error code was generate in. These module codes
					are defined by each library and are listed in the main definitions
					file for each library.}
			{item: Error/Warning code: This value indicates the actual error or warning
					code that was generated. Error codes will be negative numbers and
					warning codes will be positive numbers. There are two types of
					error/warning codes, global ones defined in rverror.h and module
					specific ones which can be found in the header file of each module.}
		}
	}
}
$*/
typedef RvInt32 RvStatus;

/* Error code layout (32 bits, 0 = low order bit, 31 = high order/sign bit): */
/* Bits 0-9, 31: Error code (range includes sign bit: -1 to -1023, 1 to 1023)*/
/* Bits 10-19: Module code (range: 1 to 1023) */
/* Bits 20-30: Library code (range: 1 to 2047) */
#define RV_ERROR_MODULE_STARTBIT  10 /* skip this many bits for the error code */
#define RV_ERROR_LIB_STARTBIT 20 /* skip this many bits for error and module codes */
#define RV_ERROR_ERROR_MASK  0x800003FF /* include sign bit */
#define RV_ERROR_MODULE_MASK 0x000FFC00
#define RV_ERROR_LIB_MASK    0x7FF00000

/* Error Macros: See documentation blocks below for details. */
#define RvErrorCode(_p, _m, _e) ((RvStatus)(((RvUint32)(_e) & RV_ERROR_ERROR_MASK) | ((_p) << RV_ERROR_LIB_STARTBIT) | ((_m) << RV_ERROR_MODULE_STARTBIT)))
#define RvErrorGetCode(_e) ((RvStatus)(((_e) < 0) ? ((RvUint32)(_e) | (~RV_ERROR_ERROR_MASK)) : ((RvUint32)(_e) & RV_ERROR_ERROR_MASK)))
#define RvErrorGetModule(_e) (((_e) & RV_ERROR_MODULE_MASK) >> RV_ERROR_MODULE_STARTBIT)
#define RvErrorGetLib(_e) (((_e) & RV_ERROR_LIB_MASK) >> RV_ERROR_LIB_STARTBIT)
/* Macro Docs */
/*$
{function:
	{name: RvErrorCode}
	{superpackage: Error}
	{include: rverror.h}
	{description:
		{p: Create a status code.}
	}
	{proto: RvStatus RvErrorCode(RvUint32 _p, RvUint32 _m, RvInt32 _e);}
	{params:
		{param: {n: _p} {d: Library code.}}
		{param: {n: _m} {d: Module code.}}
		{param: {n: _e} {d: Error or warning code.}}
	}
	{returns: Status code.}
}
$*/
/*$
{function:
	{name: RvErrorGetCode}
	{superpackage: Error}
	{include: rverror.h}
	{description:
		{p: Get the error or warning code from a status code.}
	}
	{proto: RvStatus RvErrorGetCode(RvStatus _e);}
	{params:
		{param: {n: _e} {d: Status code to get error/warning code from.}}
	}
	{returns: Error or warning code.}
}
$*/
/*$
{function:
	{name: RvErrorGetModule}
	{superpackage: Error}
	{include: rverror.h}
	{description:
		{p: Get the module code from a status code.}
	}
	{proto: RvStatus RvErrorGetModule(RvStatus _e);}
	{params:
		{param: {n: _e} {d: Status code to get module code from.}}
	}
	{returns: Module code.}
}
$*/
/*$
{function:
	{name: RvErrorGetLib}
	{superpackage: Error}
	{include: rverror.h}
	{description:
		{p: Get the library code from a status code.}
	}
	{proto: RvStatus RvErrorGetLib(RvStatus _e);}
	{params:
		{param: {n: _e} {d: Status code to get library code from.}}
	}
	{returns: Library code.}
}
$*/

/* OK value. If RvStatus < RV_OK then its an error. If RvStatus > RV_OK */
/* then its a warning. */
#define RV_OK RvInt32Const(0)

/* Library Codes 1..2047 */
#define RV_ERROR_LIBCODE_CUTILS 1
#define RV_ERROR_LIBCODE_CCORE 2
#define RV_ERROR_LIBCODE_CBASE 3
#define RV_ERROR_LIBCODE_MGCP 4
#define RV_ERROR_LIBCODE_MEGACO 5
#define RV_ERROR_LIBCODE_SIP 6
#define RV_ERROR_LIBCODE_H323 7
#define RV_ERROR_LIBCODE_RTP 8
#define RV_ERROR_LIBCODE_SDP 9
#define RV_ERROR_LIBCODE_OLDRTP 10
#define RV_ERROR_LIBCODE_EPP 11
#define RV_ERROR_LIBCODE_H223 12

/* Module Codes 1..1023 */
/* These codes are specific to each library and should be defined */
/* in the main header file for each library. */

/* Error Codes */
/* Negative error codes are real error while positive codes are used */
/* to indicate a warning. Codes in the range -1 to -511 and 1 to 511 */
/* are defined here and are common errors that may be used by any module. */
/* Codes in the range -512 to -1023 and 512 to 1023 may be defined on a */
/* module by module basis and should be defined in that module's header */
/* file. */

/* Common Error Codes -1..-511 */
#define RV_ERROR_UNKNOWN -1        /* There was an error, but we don't know specifics */
#define RV_ERROR_OUTOFRESOURCES -2 /* no resource left for this operation */
#define RV_ERROR_BADPARAM -3       /* parameter value invalid */
#define RV_ERROR_NULLPTR -4        /* required pointer parameter was a NULL pointer */
#define RV_ERROR_OUTOFRANGE -5     /* parameter out of range */
#define RV_ERROR_DESTRUCTED -6     /* operation attempted on a destructed object */
#define RV_ERROR_NOTSUPPORTED -7   /* request not supported under current configuration */
#define RV_ERROR_UNINITIALIZED -8  /* object uninitialized */



/* Common Warning Codes 1..511 */
/* None yet.*/

#endif /* RV_ERROR_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -