Home > Support > Documentation

osrtexi.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007-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  *****************************************************************************/
00048 #ifndef _OSRTEXI_H_
00049 #define _OSRTEXI_H_
00050 
00051 #include "rtxsrc/rtxContext.h"
00052 #include "rtxsrc/rtxStack.h"
00053 #include "rtexisrc/rtEXIEncAutomaton.h"
00054 #include "rtexisrc/rtEXIEncStringTables.h"
00055 #include "rtexisrc/rtEXIDecStringTables.h"
00056 #include "rtxsrc/rtxDiagBitTrace.h"
00057 
00058 #ifdef __cplusplus
00059 extern "C" {
00060 #endif
00061 
00062 #define OSEXINULLINDEX OSUINT32_MAX
00063 
00064 #define OSEXI_PRESERVE_DTD      0x80000000
00065 #define OSEXI_PRESERVE_PIS      0x40000000
00066 #define OSEXI_PRESERVE_COMMENTS 0x20000000
00067 #define OSEXI_PRESERVE_PREFIXES 0x10000000
00068 #define OSEXI_PRESERVE_LEXICAL  0x08000000
00069 #define OSEXI_FRAGMENT          0x04000000
00070 #define OSEXI_COMPRESSED        0x02000000
00071 #define OSEXI_ALIGNED           0x01000000
00072 #define OSEXI_PRECOMPRESSED     0x00800000
00073 #define OSEXI_SCHEMA            0x00400000
00074 
00075 typedef struct {
00076    OSFreeCtxtAppInfoPtr  pFreeFunc;     /* Free function pointer        */
00077    OSResetCtxtAppInfoPtr pResetFunc;    /* Reset function pointer       */
00078    OSUINT32              options;       /* Preserve options bit mask    */
00079    OSEXIAutomaton*       pCurrAtm;      /* Current automaton            */
00080    OSEXIAutomaton*       pEncDocAtm;    /* Encode document automaton    */
00081    OSEXIAutomaton*       pEncSTypeAtm;  /* Encode simple type automaton */
00082    OSEXIAutomaton*       pDecDocAtm;    /* Decode document automaton    */
00083    OSRTStack             atmStack;      /* Automaton stack              */
00084    OSRTStack             dynAtmStack;   /* Dynamic automaton data stack */
00085    OSEXIEncStringTables  encStrTabs;    /* Encoder string tables        */
00086    OSRTHashMap           automataMap;   /* Existing element grammars    */
00087 
00095    OSEXIEvent* pDecState;
00096 
00100    OSXMLFullQName* pDecQName;
00101     
00105    const OSUTF8CHAR* pDecValue;
00106     
00110    const OSUTF8CHAR* pDecPrefix;
00111     
00115    const OSUTF8CHAR* pDecNamespaceURI;
00116 
00117    OSEXIDecStringTables  decStrTabs;    /* Decoder string tables        */
00118 
00119    OSRTDiagBitFieldList  bitFieldList;  /* Bit field list               */
00120 
00125    OSUINT32 blockSize; /* EXI option (max of AT and CH values in block) */
00126    OSUINT32 valueCnt; /* AT and CH value counter */
00127    OSUINT32 firstChannel;
00128    OSUINT32 nmChannels;
00129    OSUINT32* valuesInChannel;
00130    OSUINT32 allocatedValueCnts;
00131    OSRTHashMap attrChannelMap;
00132    size_t lastValuePos;
00133    size_t firstValuePos;
00134    OSUINT32 curAttrChannel;
00135    
00136    OSRTBuffer savedBuffer;
00137    OSRTFLAGS savedFlags;
00138    OSOCTET* shadowBuff;
00139    size_t shadowBuffSize;
00140    size_t shadowBuffEnd;
00141    
00142 } OSEXICtxtInfo;
00143 
00144 #define EXICTXT(pctxt) ((OSEXICtxtInfo*)((pctxt)->pEXIInfo))
00145 
00146 typedef struct {
00147    OSBOOL mbOptionsPresent;
00148    OSBOOL mbPreview;
00149    OSUINT32 version;
00150 
00151    /* TODO: Options field */
00152 
00153 } OSEXIHeader;
00154 
00164 EXTERNEXI int rtEXIInitContext (OSCTXT* pctxt);
00165 
00175 EXTERNEXI int rtEXIInitCtxtAppInfo (OSCTXT* pctxt);
00176 
00183 EXTERNEXI void rtEXIEnableBitFieldTrace (OSCTXT* pctxt);
00184 
00207 #define rtEXISetBufPtr(pctxt,bufaddr,bufsiz) \
00208 rtxCtxtSetBufPtr (pctxt, bufaddr, bufsiz)
00209 
00218 #define rtEXIGetMsgPtr(pctxt) (pctxt)->buffer.data
00219 
00225 #define rtEXIGetMsgLen(pctxt) (pctxt)->buffer.byteIndex
00226 
00238 #define rtEXISetOption(pctxt,option) \
00239 EXICTXT(pctxt)->options |= option;
00240 
00252 #define rtEXIClearOption(pctxt,option) \
00253 EXICTXT(pctxt)->options &= ~option;
00254 
00268 #define rtEXITestOption(pctxt,option) \
00269 ((EXICTXT(pctxt)->options & option) != 0)
00270 
00271 #ifdef __cplusplus
00272 }
00273 #endif
00274 
00277 #endif /* _OSRTEXI_H_ */