Home > Support > Documentation

osrtexi.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2008 by Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00045 #ifndef _OSRTEXI_H_
00046 #define _OSRTEXI_H_
00047 
00048 #include "rtxsrc/rtxContext.h"
00049 #include "rtxsrc/rtxStack.h"
00050 #include "rtexisrc/rtEXIEncAutomaton.h"
00051 #include "rtexisrc/rtEXIEncStringTables.h"
00052 #include "rtexisrc/rtEXIDecStringTables.h"
00053 #include "rtxsrc/rtxDiagBitTrace.h"
00054 
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058 
00059 #define OSEXINULLINDEX OSUINT32_MAX
00060 
00061 #define OSEXI_PRESERVE_DTD      0x80000000
00062 #define OSEXI_PRESERVE_PIS      0x40000000
00063 #define OSEXI_PRESERVE_COMMENTS 0x20000000
00064 #define OSEXI_PRESERVE_PREFIXES 0x10000000
00065 #define OSEXI_PRESERVE_LEXICAL  0x08000000
00066 #define OSEXI_FRAGMENT          0x04000000
00067 #define OSEXI_COMPRESSED        0x02000000
00068 #define OSEXI_ALIGNED           0x01000000
00069 #define OSEXI_PRECOMPRESSED     0x00800000
00070 
00071 typedef struct {
00072    OSFreeCtxtAppInfoPtr  pFreeFunc;     /* Free function pointer        */
00073    OSResetCtxtAppInfoPtr pResetFunc;    /* Reset function pointer       */
00074    OSUINT32              options;       /* Preserve options bit mask    */
00075    OSEXIAutomaton*       pCurrAtm;      /* Current automaton            */
00076    OSRTStack             atmStack;      /* Automaton stack              */
00077    OSRTStack             dynAtmStack;   /* Dynamic automaton data stack */
00078    OSEXIEncStringTables  encStrTabs;    /* Encoder string tables        */
00079    OSRTHashMap           automataMap;   /* Existing element grammars    */
00080 
00088    OSEXIEvent* pDecState;
00089 
00093    OSXMLFullQName* pDecQName;
00094     
00098    const OSUTF8CHAR* pDecValue;
00099     
00103    const OSUTF8CHAR* pDecPrefix;
00104     
00108    const OSUTF8CHAR* pDecNamespaceURI;
00109 
00110    OSEXIDecStringTables  decStrTabs;    /* Decoder string tables        */
00111 
00112    OSRTDiagBitFieldList  bitFieldList;  /* Bit field list               */
00113 
00114 } OSEXICtxtInfo;
00115 
00116 #define EXICTXT(pctxt) ((OSEXICtxtInfo*)((pctxt)->pEXIInfo))
00117 
00118 typedef struct {
00119    OSBOOL mbOptionsPresent;
00120    OSBOOL mbPreview;
00121    OSUINT32 version;
00122 
00123    /* TODO: Options field */
00124 
00125 } OSEXIHeader;
00126 
00136 EXTERNEXI int rtEXIInitContext (OSCTXT* pctxt);
00137 
00147 EXTERNEXI int rtEXIInitCtxtAppInfo (OSCTXT* pctxt);
00148 
00171 EXTERNEXI int rtEXISetBufPtr 
00172 (OSCTXT* pctxt, OSOCTET* bufaddr, size_t bufsiz);
00173 
00182 #define rtEXIGetMsgPtr(pctxt) (pctxt)->buffer.data
00183 
00189 #define rtEXIGetMsgLen(pctxt) (pctxt)->buffer.byteIndex
00190 
00202 #define rtEXISetOption(pctxt,option) \
00203 EXICTXT(pctxt)->options |= option;
00204 
00216 #define rtEXIClearOption(pctxt,option) \
00217 EXICTXT(pctxt)->options &= ~option;
00218 
00232 #define rtEXITestOption(pctxt,option) \
00233 ((EXICTXT(pctxt)->options & option) != 0)
00234 
00235 #ifdef __cplusplus
00236 }
00237 #endif
00238 
00241 #endif /* _OSRTEXI_H_ */