Changeset 35 for trunk/include


Ignore:
Timestamp:
Feb 14, 2001, 10:01:57 PM (25 years ago)
Author:
umoeller
Message:

Added XML.

Location:
trunk/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/cnrh.h

    r21 r35  
    140140                            PRECORDCORE precc,
    141141                            BOOL fInvalidate,
    142                             PSZ pszText,
     142                            const char *pcszText,
    143143                            ULONG flRecordAttr,
    144144                            ULONG ulCount);
  • trunk/include/helpers/linklist.h

    r20 r35  
    216216                                void* pStorage);
    217217
     218    /* ******************************************************************
     219     *
     220     *   List pseudo-stacks
     221     *
     222     ********************************************************************/
     223
     224    PLISTNODE lstPush(PLINKLIST pList,
     225                      void* pNewItemData);
     226
     227    PLISTNODE lstPop(PLINKLIST pList);
     228
    218229#endif
    219230
  • trunk/include/helpers/xml.h

    r10 r35  
    88 *@@added V0.9.6 (2000-10-29) [umoeller]
    99 *@@include #include <os2.h>
    10  *@@include #include "linklist.h"
    11  *@@include #include "xml.h"
     10 *@@include #include "expat\expat.h"
     11 *@@include #include "helpers\linklist.h"
     12 *@@include #include "helpers\xstring.h"
     13 *@@include #include "helpers\xml.h"
    1214 */
    1315
     
    3436    #endif
    3537
    36     #define DOMERR_INDEX_SIZE                  1;
    37     #define DOMERR_DOMSTRING_SIZE              2;
    38     #define DOMERR_HIERARCHY_REQUEST           3;
    39     #define DOMERR_WRONG_DOCUMENT              4;
    40     #define DOMERR_INVALID_CHARACTER           5;
    41     #define DOMERR_NO_DATA_ALLOWED             6;
    42     #define DOMERR_NO_MODIFICATION_ALLOWED     7;
    43     #define DOMERR_NOT_FOUND                   8;
    44     #define DOMERR_NOT_SUPPORTED               9;
    45     #define DOMERR_INUSE_ATTRIBUTE            10;
     38    #define ERROR_DOM_FIRST                14000
     39
     40    #define ERROR_DOM_INDEX_SIZE                   (ERROR_DOM_FIRST + 1)
     41    #define ERROR_DOM_DOMSTRING_SIZE               (ERROR_DOM_FIRST + 2)
     42    #define ERROR_DOM_HIERARCHY_REQUEST            (ERROR_DOM_FIRST + 3)
     43    #define ERROR_DOM_WRONG_DOCUMENT               (ERROR_DOM_FIRST + 4)
     44    #define ERROR_DOM_INVALID_CHARACTER            (ERROR_DOM_FIRST + 5)
     45    #define ERROR_DOM_NO_DATA_ALLOWED              (ERROR_DOM_FIRST + 6)
     46    #define ERROR_DOM_NO_MODIFICATION_ALLOWED      (ERROR_DOM_FIRST + 7)
     47    #define ERROR_DOM_NOT_FOUND                    (ERROR_DOM_FIRST + 8)
     48    #define ERROR_DOM_NOT_SUPPORTED                (ERROR_DOM_FIRST + 9)
     49    #define ERROR_DOM_INUSE_ATTRIBUTE              (ERROR_DOM_FIRST + 10)
     50
     51    #define ERROR_DOM_PARSING                      (ERROR_DOM_FIRST + 11)
    4652
    4753    #define DOMNODE_ELEMENT         1          // node is an ELEMENT
     
    8793    {
    8894        ULONG       ulNodeType;
     95                    // one of:
     96                    // -- DOMNODE_ELEMENT
     97                    // -- DOMNODE_ATTRIBUTE
     98                    // -- DOMNODE_TEXT
     99                    // -- DOMNODE_CDATA_SECTION
     100                    // -- DOMNODE_ENTITY_REFERENCE
     101                    // -- DOMNODE_ENTITY
     102                    // -- DOMNODE_PROCESSING_INSTRUCTION
     103                    // -- DOMNODE_COMMENT
     104                    // -- DOMNODE_DOCUMENT: the root document. See @documents.
     105                    // -- DOMNODE_DOCUMENT_TYPE
     106                    // -- DOMNODE_DOCUMENT_FRAGMENT
     107                    // -- DOMNODE_NOTATION
    89108
    90         PSZ         pszNodeName;
    91         PSZ         pszNodeValue;
     109        XSTRING     strNodeName;            // malloc()'d
     110        XSTRING     strNodeValue;           // malloc()'d
    92111
    93112        struct _DOMNODE *pParentNode;
    94113                        // the parent node;
    95114                        // NULL for DOCUMENT, DOCUMENT_FRAGMENT and ATTR
    96         LINKLIST    listChildNodes;     // of DOMNODE* pointers
    97115
    98         LINKLIST    listAttributeNodes; // of DOMNODE* pointers
     116        LINKLIST    llChildNodes;     // of DOMNODE* pointers, no auto-free
     117
     118        LINKLIST    llAttributeNodes; // of DOMNODE* pointers, no auto-free
    99119
    100120    } DOMNODE, *PDOMNODE;
     
    111131    ULONG xmlDeleteNode(PDOMNODE pNode);
    112132
    113     ULONG xmlParse(PDOMNODE pParentNode,
    114                    const char *pcszBuf,
    115                    PFNVALIDATE pfnValidateTag);
     133    /* ******************************************************************
     134     *
     135     *   DOM APIs
     136     *
     137     ********************************************************************/
    116138
    117     PDOMNODE xmlCreateDocumentFromString(const char *pcszXML,
    118                                          PFNVALIDATE pfnValidateTag);
     139    /*
     140     *@@ XMLDOM:
     141     *      DOM instance returned by xmlCreateDOM.
     142     *
     143     *@@added V0.9.9 (2000-02-14) [umoeller]
     144     */
     145
     146    typedef struct _XMLDOM
     147    {
     148        /*
     149         *  Public fields (should be read only)
     150         */
     151
     152        PDOMNODE        pDocumentNode;
     153
     154        enum XML_Error  Error;
     155        const char      *pcszErrorDescription;
     156        ULONG           ulErrorLine;
     157        ULONG           ulErrorColumn;
     158
     159        /*
     160         *  Private fields (for xml* functions)
     161         */
     162
     163        XML_Parser      pParser;
     164                            // expat parser instance
     165
     166        LINKLIST        llStack;
     167                            // stack for maintaining the current items;
     168                            // these point to the NODERECORDs (no auto-free)
     169
     170        PDOMNODE        pLastWasTextNode;
     171    } XMLDOM, *PXMLDOM;
     172
     173    APIRET xmlCreateDOM(ULONG flParserFlags,
     174                        PXMLDOM *ppDom);
     175
     176    APIRET xmlParse(PXMLDOM pDom,
     177                    const char *pcszBuf,
     178                    ULONG cb,
     179                    BOOL fIsLast);
     180
     181    APIRET xmlFreeDOM(PXMLDOM pDom);
    119182
    120183#endif
  • trunk/include/setup.h

    r15 r35  
    1616        #define XWPENTRY _Optlink
    1717    #endif
     18
     19    #error This file shouldn't be included.
    1820
    1921    /*************************************************************
Note: See TracChangeset for help on using the changeset viewer.