📄 ospxmlelem.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. * *******#########################################################################*#########################################################################*#########################################################################*//* * ospxmlelem.h - Structures and prototypes for generic XML elements. */#ifndef _OSPXMLELEM_H#define _OSPXMLELEM_H#include "osp.h"#include "osplist.h"#include "ospxmlattr.h"/* * An XMLElem structure represents an XML element in its natural * form ("natural" in the sense of easiest to reference in code). * It includes pointers to child elements and attributes, as * well as the element name and actual character string for the * element. */typedef struct{ OSPTLISTLINK ospmXMLElemLink; OSPTLIST ospmXMLElemChild; OSPTLIST ospmXMLElemAttrs; char *ospmXMLElemName; char *ospmXMLElemValue;}OSPTXMLELEM;/**//*-----------------------------------------------------------------------* * macros that emulate functions *-----------------------------------------------------------------------*//* * Note: all macros are also implemented as functions in ospxmlelem.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 OSPPXMLElemGetName(ospvElem) (ospvElem)?((ospvElem)->ospmXMLElemName):OSPC_OSNULL#define OSPPXMLElemGetValue(ospvElem) (ospvElem)?((ospvElem)->ospmXMLElemValue):OSPC_OSNULL#define OSPPXMLElemAddChild(ospvElem, ospvChild) \ OSPPListAppend((OSPTLIST *) &(ospvElem)->ospmXMLElemChild, (ospvChild))#define OSPPXMLElemFirstChild(ospvElem) \ OSPPListFirst((OSPTLIST *) &(ospvElem)->ospmXMLElemChild)#define OSPPXMLElemNextChild(ospvElem, ospvChild) \ OSPPListNext((OSPTLIST *) &(ospvElem)->ospmXMLElemChild, (ospvChild))#define OSPPXMLElemAddAttr(ospvElem, ospvAttr) \ OSPPListAppend((OSPTLIST *) &(ospvElem)->ospmXMLElemAttrs, (ospvAttr))#define OSPPXMLElemFirstAttr(ospvElem) \ OSPPListFirst((OSPTLIST *) &(ospvElem)->ospmXMLElemAttrs)#define OSPPXMLElemNextAttr(ospvElem, ospvAttr) \ OSPPListNext((OSPTLIST *) &(ospvElem)->ospmXMLElemAttrs, (ospvAttr))#endif/**//*-----------------------------------------------------------------------* * function prototypes *-----------------------------------------------------------------------*/#ifdef __cplusplusextern "C" {#endif OSPTXMLELEM *OSPPXMLElemNew(const char *, const char *); void OSPPXMLElemDelete(OSPTXMLELEM **);#ifndef OSPPXMLElemGetName const char *OSPPXMLElemGetName(OSPTXMLELEM *);#endif#ifndef OSPPXMLElemGetValue const char *OSPPXMLElemGetValue(OSPTXMLELEM *);#endif#ifndef OSPPXMLElemAddChild void OSPPXMLElemAddChild(OSPTXMLELEM *, OSPTXMLELEM *);#endif#ifndef OSPPXMLElemFirstChild OSPTXMLELEM *OSPPXMLElemFirstChild(OSPTXMLELEM *);#endif#ifndef OSPPXMLElemNextChild OSPTXMLELEM *OSPPXMLElemNextChild(OSPTXMLELEM *, OSPTXMLELEM *);#endif#ifndef OSPPXMLElemAddAttr void OSPPXMLElemAddAttr(OSPTXMLELEM *, OSPTXMLATTR *);#endif#ifndef OSPPXMLElemFirstAttr OSPTXMLATTR *OSPPXMLElemFirstAttr(OSPTXMLELEM *);#endif#ifndef OSPPXMLElemNextAttr OSPTXMLATTR *OSPPXMLElemNextAttr(OSPTXMLELEM *, OSPTXMLATTR *);#endif#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -