📄 pvaltreedef.h
字号:
/***********************************************************************
Copyright (c) 2002 RADVISION Ltd.
************************************************************************
NOTICE:
This document contains information that is confidential and proprietary
to RADVISION Ltd.. No part of this document may be reproduced in any
form whatsoever without written prior approval by RADVISION Ltd..
RADVISION Ltd. reserve the right to revise this publication and make
changes without obligation to notify any person of such revisions or
changes.
***********************************************************************/
#ifndef _PVALTREE_DEF_H
#define _PVALTREE_DEF_H
#include "rtree.h"
#include "rpool.h"
#include "rvmutex.h"
#include "psyntreeDb.h"
#include "psyntreeStackApi.h"
#include "pvaltree.h"
#ifdef __cplusplus
extern "C" {
#endif
/************************************************************************
* pvtPrintDegree enum
* Used to define what will be printed for each node of a tree
* pvtPrintDegreeSyntax - Display syntax information
* pvtPrintDegreeNodeId - Display node ID for each node
* pvtPrintDegreeValue - Always print the node's value
* pvtPrintDegreeSyntaxId - Display syntax node ID for each node
*
* pvtPrintDegreeNode - Print nothing
* pvtPrintDegreeAll - Print everything
************************************************************************/
typedef enum
{
pvtPrintDegreeSyntax = 0x1, /* display syntax information */
pvtPrintDegreeNodeId = 0x2,
pvtPrintDegreeValue = 0x4, /* always print node value */
pvtPrintDegreeSyntaxId = 0x8,
pvtPrintDegreeNone = 0x0,
pvtPrintDegreeAll = 0xffff
} pvtPrintDegree;
/************************************************************************
* vtStruct
* PVT handle contents
* vTree - Value tree handle to use
* Should be first field for performance reasons
* sPool - Strings pool. Holds all the strings for the nodes
* log - Log handle to use for PVT related messages
* unregLog - Log handle used for PVT messages by user on no-log handle
* lock - Mutex to use for locking
*
* Tree printing related variables
* pFunc - Print function to use for each node printed
* pFuncParam - The context to pass to the print function on each printed line
* printOnlyRoots - Indicates if debug printing of all nodes will print only the
* roots or the whole trees
* degree - Details degree of the printing
************************************************************************/
typedef struct
{
HRTREE vTree;
HRPOOL sPool;
RvLogSource log;
RvLogSource unregLog;
RvMutex mutex;
/* Printing related variables */
pvtPrintFuncP pFunc;
void * pFuncParam;
RvBool printOnlyRoots;
pvtPrintDegree degree;
} vtStruct;
/************************************************************************
* vtNode
* PVT node contents
* hSyn - Syntax tree of the node
* Make sure it's first (optimized pointer access)
* synFieldAndNode - Field and node in syntax tree
* string - String stored inside node
* NULL if it doesn't exist
* value - Value of node for non-string values
* Length of string for string values
************************************************************************/
typedef struct
{
HPST hSyn;
RvUint32 synFieldAndNode;
HRPOOLELEM string;
RvInt32 value;
} vtNode;
/************************************************************************
*
* Private macros
*
************************************************************************/
#define VTN_SYN_FIELD(_vtnode) ((RvInt16)((_vtnode)->synFieldAndNode & 0xFFFF))
#define VTN_SYN_NODE(_vtnode) ((RvPstNodeId)((RvInt16)((_vtnode)->synFieldAndNode >> 16)))
#define VTN_SET_SYN_INFO(vtnode, node, field) \
((vtnode)->synFieldAndNode = ((RvUint)node << 16) + (RvUint16)field)
#define VTN_SET_SYN_FIELD(vtnode, field) \
((vtnode)->synFieldAndNode = ((vtnode)->synFieldAndNode & 0xFFFF0000) + (RvUint)field);
#define VTN_SET_SYN_NODE(vtnode, node) \
((vtnode)->synFieldAndNode = ((vtnode)->synFieldAndNode & 0xFFFF) + ((RvUint)node << 16))
#define GET_NODE(_vt, _nodeId) \
((vtNode *)rtGetByPath(((vtStruct *)(_vt))->vTree, (int)(_nodeId)))
/* Definitions of errors in the pvt */
#define RV_PVT_ERROR_UNKNOWN (RvPvtNodeId)RV_ERROR_UNKNOWN
#define RV_PVT_ERROR_OUTOFRESOURCES (RvPvtNodeId)RV_ERROR_OUTOFRESOURCES
#ifdef __cplusplus
}
#endif
#endif /* _PVALTREE_DEF_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -