📄 rvtypes.h
字号:
#if (0)
******************************************************************************
Filename:
Description:
******************************************************************************
Copyright (c) 1999 RADVision Inc.
************************************************************************
NOTICE:
This document contains information that is proprietary to RADVision LTD.
No part of this publication may be reproduced in any form whatsoever
without written prior approval by RADVision LTD..
RADVision LTD. reserves the right to revise this publication and make
changes without obligation to notify any person of such revisions or
changes.
******************************************************************************
$Revision:$
$Date:$
$Author: S. Cipolli$
******************************************************************************
#endif
#ifndef RV_TYPES_H
#define RV_TYPES_H
#if defined(__cplusplus)
extern "C" {
#endif
#include <string.h>
#include "rvplatform.h"
/* Parameter direction modifiers */
#define IN
#define OUT
#define INOUT
/*$
{type:
{name: RvBool}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a boolean. The possbile values of an RvBool variable are:}
{p: rvTrue}
{p: rvFalse}
}
}
$*/
typedef int RvBool;
#define rvFalse 0
#define rvTrue 1
/* Status */
typedef int RvStatus;
#define rvOk 0
/* Typedefs for making basic types a single token for container preprocesor macros */
typedef unsigned int RvUint;
typedef void* RvVoidPtr;
typedef char* RvCharPtr;
/* Unsigned fixed bit length */
/*$
{type:
{name: RvUint8}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a unsigned 8-bit value.}
}
}
$*/
typedef unsigned char RvUint8;
/*$
{type:
{name: RvUint16}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a unsigned 16-bit value.}
}
}
$*/
typedef unsigned short RvUint16;
/*$
{type:
{name: RvUint32}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a unsigned 32-bit value.}
}
}
$*/
typedef unsigned int RvUint32;
/* Signed fixed bit length */
/*$
{type:
{name: RvInt8}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a signed 8-bit value.}
}
}
$*/
typedef char RvInt8;
/*$
{type:
{name: RvInt16}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a signed 16-bit value.}
}
}
$*/
typedef short RvInt16;
/*$
{type:
{name: RvInt32}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a signed 32-bit value.}
}
}
$*/
typedef int RvInt32;
/*$
{type:
{name: RvMilliseconds}
{superpackage: Util}
{include: rvtypes.h}
{description:
{p: Describes a time interval in milliseconds. }
}
}
$*/
typedef int RvMilliseconds;
/* Copy constructor for basic types */
#define rvDefaultConstructCopy(d, s, a) (*(d) = *(s))
#define charConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define intConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define floatConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define doubleConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvInt8ConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvInt16ConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvInt32ConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvUint8ConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvUint16ConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvUint32ConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvBoolConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvUintConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvVoidPtrConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
#define RvCharPtrConstructCopy(d, s, a) rvDefaultConstructCopy(d, s, a)
/* Destructor for basic types */
#define rvDefaultDestruct(x)
#define charDestruct(x) rvDefaultDestruct(x)
#define intDestruct(x) rvDefaultDestruct(x)
#define floatDestruct(x) rvDefaultDestruct(x)
#define doubleDestruct(x) rvDefaultDestruct(x)
#define RvInt8Destruct(x) rvDefaultDestruct(x)
#define RvInt16Destruct(x) rvDefaultDestruct(x)
#define RvInt32Destruct(x) rvDefaultDestruct(x)
#define RvUint8Destruct(x) rvDefaultDestruct(x)
#define RvUint16Destruct(x) rvDefaultDestruct(x)
#define RvUint32Destruct(x) rvDefaultDestruct(x)
#define RvBoolDestruct(x) rvDefaultDestruct(x)
#define RvUintDestruct(x) rvDefaultDestruct(x)
#define RvVoidPtrDestruct(x) rvDefaultDestruct(x)
#define RvCharPtrDestruct(x) rvDefaultDestruct(x)
/* Assignment operator for basic types */
#define rvDefaultCopy(d, s) (*(d) = *(s))
#define charCopy(d, s) rvDefaultCopy(d, s)
#define intCopy(d, s) rvDefaultCopy(d, s)
#define floatCopy(d, s) rvDefaultCopy(d, s)
#define doubleCopy(d, s) rvDefaultCopy(d, s)
#define RvInt8Copy(d, s) rvDefaultCopy(d, s)
#define RvInt16Copy(d, s) rvDefaultCopy(d, s)
#define RvInt32Copy(d, s) rvDefaultCopy(d, s)
#define RvUint8Copy(d, s) rvDefaultCopy(d, s)
#define RvUint16Copy(d, s) rvDefaultCopy(d, s)
#define RvUint32Copy(d, s) rvDefaultCopy(d, s)
#define RvBoolCopy(d, s) rvDefaultCopy(d, s)
#define RvUintCopy(d, s) rvDefaultCopy(d, s)
#define RvVoidPtrCopy(d, s) rvDefaultCopy(d, s)
#define RvCharPtrCopy(d, s) rvDefaultCopy(d, s)
/* Equal operator for basic types */
#define rvDefaultEqual(a, b) (*(a) == *(b))
#define charEqual(a, b) rvDefaultEqual(a, b)
#define intEqual(a, b) rvDefaultEqual(a, b)
#define floatEqual(a, b) rvDefaultEqual(a, b)
#define doubleEqual(a, b) rvDefaultEqual(a, b)
#define RvInt8Equal(a, b) rvDefaultEqual(a, b)
#define RvInt16Equal(a, b) rvDefaultEqual(a, b)
#define RvInt32Equal(a, b) rvDefaultEqual(a, b)
#define RvUint8Equal(a, b) rvDefaultEqual(a, b)
#define RvUint16Equal(a, b) rvDefaultEqual(a, b)
#define RvUint32Equal(a, b) rvDefaultEqual(a, b)
#define RvBoolEqual(a, b) rvDefaultEqual(a, b)
#define RvUintEqual(a, b) rvDefaultEqual(a, b)
#define RvVoidPtrEqual(a, b) rvDefaultEqual(a, b)
#define RvCharPtrEqual(a, b) (strcmp(*(a), *(b)) == 0)
/* Less operator for basic types */
#define rvDefaultLess(a, b) (*(a) < *(b))
#define charLess(a, b) rvDefaultLess(a, b)
#define intLess(a, b) rvDefaultLess(a, b)
#define floatLess(a, b) rvDefaultLess(a, b)
#define doubleLess(a, b) rvDefaultLess(a, b)
#define RvInt8Less(a, b) rvDefaultLess(a, b)
#define RvInt16Less(a, b) rvDefaultLess(a, b)
#define RvInt32Less(a, b) rvDefaultLess(a, b)
#define RvUint8Less(a, b) rvDefaultLess(a, b)
#define RvUint16Less(a, b) rvDefaultLess(a, b)
#define RvUint32Less(a, b) rvDefaultLess(a, b)
#define RvBoolLess(a, b) rvDefaultLess(a, b)
#define RvUintLess(a, b) rvDefaultLess(a, b)
#define RvVoidPtrLess(a, b) rvDefaultLess(a, b)
#define RvCharPtrLess(a, b) (strcmp(*(a), *(b)) < 0)
/* GetAllocator operator for basic types */
#define rvDefaultGetAllocator(x) (0)
#define charGetAllocator(x) rvDefaultGetAllocator(x)
#define intGetAllocator(x) rvDefaultGetAllocator(x)
#define floatGetAllocator(x) rvDefaultGetAllocator(x)
#define doubleGetAllocator(x) rvDefaultGetAllocator(x)
#define RvInt8GetAllocator(x) rvDefaultGetAllocator(x)
#define RvInt16GetAllocator(x) rvDefaultGetAllocator(x)
#define RvInt32GetAllocator(x) rvDefaultGetAllocator(x)
#define RvUint8GetAllocator(x) rvDefaultGetAllocator(x)
#define RvUint16GetAllocator(x) rvDefaultGetAllocator(x)
#define RvUint32GetAllocator(x) rvDefaultGetAllocator(x)
#define RvBoolGetAllocator(x) rvDefaultGetAllocator(x)
#define RvUintGetAllocator(x) rvDefaultGetAllocator(x)
#define RvVoidPtrGetAllocator(x) rvDefaultGetAllocator(x)
#define RvCharPtrGetAllocator(x) rvDefaultGetAllocator(x)
/* Swap operator for basic */
#define rvDeclareSwap(T) void _rvSwap_##T(T* a, T* b);
#define rvDefineSwap(T) \
void _rvSwap_##T(T* a, T* b) { \
T t; \
T##ConstructCopy(&t, a, T##GetAllocator(a)); \
T##Copy(a, b); \
T##Copy(b, &t); \
T##Destruct(&t); \
}
#define rvSwap(T) _rvSwap_##T
/* Swap for basic types */
#define charSwap(a, b) _rvSwap_char(a, b)
#define shortSwap(a, b) _rvSwap_short(a, b)
#define intSwap(a, b) _rvSwap_int(a, b)
#define longSwap(a, b) _rvSwap_long(a, b)
#define floatSwap(a, b) _rvSwap_float(a, b)
#define doubleSwap(a, b) _rvSwap_double(a, b)
#define RvInt8Swap(a, b) _rvSwap_RvInt8(a, b)
#define RvInt16Swap(a, b) _rvSwap_RvInt16(a, b)
#define RvInt32Swap(a, b) _rvSwap_RvInt32(a, b)
#define RvUint8Swap(a, b) _rvSwap_RvUint8(a, b)
#define RvUint16Swap(a, b) _rvSwap_RvUint16(a, b)
#define RvUint32Swap(a, b) _rvSwap_RvUint32(a, b)
#define RvBoolSwap(a, b) _rvSwap_RvBool(a, b)
#define RvUintSwap(a, b) _rvSwap_RvUint(a, b)
#define RvVoidPtrSwap(a, b) _rvSwap_RvVoidPtr(a, b)
#define RvCharPtrSwap(a, b) _rvSwap_RvCharPtr(a, b)
/* Declare swap functions */
rvDeclareSwap(char)
rvDeclareSwap(int)
rvDeclareSwap(float)
rvDeclareSwap(double)
rvDeclareSwap(RvInt8)
rvDeclareSwap(RvInt16)
rvDeclareSwap(RvInt32)
rvDeclareSwap(RvUint8)
rvDeclareSwap(RvUint16)
rvDeclareSwap(RvUint32)
rvDeclareSwap(RvBool)
rvDeclareSwap(RvUint)
rvDeclareSwap(RvVoidPtr)
rvDeclareSwap(RvCharPtr)
size_t RvCharPtrHash(const RvCharPtr* x);
#if defined(__cplusplus)
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -