📄 ospaltinfo.h
字号:
/**########################################################################*########################################################################*########################################################################* * COPYRIGHT (c) 1998, 1999 by TransNexus, LLC * * This software contains proprietary and confidential information * of TransNexus, LLC. Except as may be set forth in the license * agreement under which this software is supplied, use, disclosure, * or reproduction is prohibited without the prior, express, written* consent of TransNexus, LLC. * *******#########################################################################*#########################################################################*#########################################################################*//* * ospaltinfo.h - OSP Alternate information element */#ifndef _OSPALTINFO_H#define _OSPALTINFO_H#include "osp.h"#include "ospxmlelem.h"#include "ospmsgelem.h"#include "ospmsg.h"/* max size of an altinfo (bytes) */#define OSPC_ALTINFOMAXSIZE 1024typedef enum{ ospetypeupper, ospeE164, ospeH323, ospeUrl, ospeEmail, ospeTransport, ospeInternational, ospeNational, ospeNetwork, ospeSubscriber, ospeAbbreviated, ospeE164prefix, ospetypelower}OSPE_TYPE_ATTR_VAL;/* the basic altinfo structure */typedef struct{ OSPTLISTLINK ospmAltInfoLink; unsigned ospmAltInfoLen; OSPE_TYPE_ATTR_VAL ospmAltInfoType; unsigned char *ospmAltInfoVal;}OSPTALTINFO;typedef struct{ OSPE_TYPE_ATTR_VAL ospmType; const char *ospmTypeStr;}OSP_TYPE_ATTR_STRUCT;/**//*-----------------------------------------------------------------------* * macros that emulate functions *-----------------------------------------------------------------------*//* * Note: all macros are also implemented as functions in ospaltinfo.c. * For implementation details, see the comments in that file. To replace * a macro with a true function, simply comment out the macro definition * below. */#ifndef OSPC_DEBUG#define OSPPAltInfoDelete(ospvAltInfo) OSPM_FREE(*ospvAltInfo); *ospvAltInfo = OSPC_OSNULL;#define OSPPAltInfoGetSize(ospvAltInfo) ospvAltInfo?((ospvAltInfo)->ospmAltInfoLen):0#define OSPPAltInfoGetType(ospvAltInfo) ospvAltInfo?((ospvAltInfo)->ospmAltInfoType):ospetypeupper#define OSPPAltInfoGetValue(ospvAltInfo) ospvAltInfo?((ospvAltInfo)->ospmAltInfoVal):OSPC_OSNULL#define OSPPAltInfoToElement(ospvAltInfo, ospvElem, ospvPart) \ OSPPMsgBinToElement(OSPPAltInfoGetSize(ospvAltInfo), \ (unsigned char *)OSPPAltInfoGetValue(ospvAltInfo), \ (const unsigned char *)OSPPMsgGetElemName(ospvPart), ospvElem, OSPC_FALSE)#endif #ifdef __cplusplusextern "C"{#endif /**/ /*-----------------------------------------------------------------------* * function prototypes *-----------------------------------------------------------------------*/ OSPTALTINFO *OSPPAltInfoNew(unsigned, const unsigned char *, OSPE_TYPE_ATTR_VAL);#ifdef OSPC_DEBUG void OSPPAltInfoDelete(OSPTALTINFO **); unsigned OSPPAltInfoGetSize(OSPTALTINFO *); OSPE_TYPE_ATTR_VAL OSPPAltInfoGetType(OSPTALTINFO *); const unsigned char *OSPPAltInfoGetValue(OSPTALTINFO *); unsigned OSPPAltInfoToElement(OSPTALTINFO *, OSPTXMLELEM **, OSPTMSGELEMPART); const char *OSPPAltInfoGetTypeName(OSPTALTINFO *);#endif#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -