28 #ifndef _RTXCONTEXT_H_ 29 #define _RTXCONTEXT_H_ 32 #include "rtxsrc/rtxStack.h" 34 #define OSRTENCBUFSIZ 1024 42 #define OSRTERRSTKSIZ 8 43 #define OSRTMAXERRPRM 5 53 const OSUTF8CHAR* module;
72 OSUTF8CHAR* parms[OSRTMAXERRPRM];
103 typedef OSUINT32 OSRTFLAGS;
130 #define OSDIAG 0x80000000 131 #define OSTRACE 0x40000000 132 #define OSDISSTRM 0x20000000 133 #define OSNOSTRMBACKOFF 0x08000000 134 #define OS3GMOBORIG 0x04000000 141 #define OSCONTCLOSED 0x02000000 142 #define OSRESERVED1 0x01000000 143 #define OSBUFSYSALLOC 0x00800000 144 #define OSLICCHECKIN 0x00400000 150 #define OSNOWHITESPACE 0x00400000 181 #if !defined(OSCDECL) 182 #if defined(_MSC_VER) || defined(__BORLANDC__) 183 #define OSCDECL __cdecl 189 #define pLicInfo pli709 202 OSRTErrInfoList errInfo;
216 #ifndef _OS_NOPATTERN 236 OSVoidPtr pGlobalData;
237 struct OS3GPPSecParams* p3gppSec;
240 struct OSRTDiagBitFieldList* pBitFldList;
247 #define OSRT_GET_FIRST_ERROR_INFO(pctxt) \ 248 (((pctxt)->errInfo.list.head == 0) ? (OSRTErrInfo*)0 : \ 249 (OSRTErrInfo*)((pctxt)->errInfo.list.head->data)) 251 #define OSRT_GET_LAST_ERROR_INFO(pctxt) \ 252 (((pctxt)->errInfo.list.tail == 0) ? (OSRTErrInfo*)0 : \ 253 (OSRTErrInfo*)((pctxt)->errInfo.list.tail->data)) 260 #define OSRTISSTREAM(pctxt) \ 261 ((pctxt)->pStream != 0 && !((pctxt)->flags & OSDISSTRM)) 263 #define OSRTISBUFSTREAM(pctxt) \ 264 (OSRTISSTREAM(pctxt) && (0 != ((pctxt)->pStream->flags & OSRTSTRMF_BUFFERED))) 268 #define OSRTISSTREAM(pctxt) FALSE 269 #define OSRTISBUFSTREAM(pctxt) FALSE 273 #define OSRTBUFCUR(pctxt) (pctxt)->buffer.data[(pctxt)->buffer.byteIndex] 274 #define OSRTBUFPTR(pctxt) &(pctxt)->buffer.data[(pctxt)->buffer.byteIndex] 275 #define OSRTBUFFER(pctxt) (pctxt)->buffer.data 276 #define OSRTBUFSIZE(pctxt) (pctxt)->buffer.size 278 #define OSRTBUFSAVE(pctxt) { \ 279 (pctxt)->savedInfo.byteIndex = (pctxt)->buffer.byteIndex; \ 280 (pctxt)->savedInfo.flags = (pctxt)->flags; } 282 #define OSRTBUFSAVE2(pctxt,pSavedBuf) { \ 283 (pSavedBuf)->byteIndex = (pctxt)->buffer.byteIndex; \ 284 (pSavedBuf)->bitOffset = (pctxt)->buffer.bitOffset; \ 285 (pSavedBuf)->flags = (pctxt)->flags; } 287 #define OSRTBUFRESTORE(pctxt) { \ 288 (pctxt)->buffer.byteIndex = (pctxt)->savedInfo.byteIndex; \ 289 (pctxt)->flags = (pctxt)->savedInfo.flags; } 291 #define OSRTBUFRESTORE2(pctxt,pSavedBuf) { \ 292 (pctxt)->buffer.byteIndex = (pSavedBuf)->byteIndex; \ 293 (pctxt)->buffer.bitOffset = (pSavedBuf)->bitOffset; \ 294 (pctxt)->flags = (pSavedBuf)->flags; } 296 #define OSRTBYTEALIGNED(pctxt) \ 297 ((pctxt)->buffer.bitOffset == 8 || (pctxt)->buffer.bitOffset == 0) 301 typedef void *(OSCDECL *OSMallocFunc ) (OSSIZE size);
302 typedef void *(OSCDECL *OSReallocFunc) (
void *ptr, OSSIZE size);
303 typedef void (OSCDECL *OSFreeFunc ) (
void *ptr);
338 #ifndef rtxInitContext 357 OSMallocFunc malloc_func,
358 OSReallocFunc realloc_func,
359 OSFreeFunc free_func);
398 (
OSCTXT* pctxt,
const OSOCTET* key, OSSIZE keylen);
419 (
OSCTXT* pctxt, OSOCTET* bufaddr, OSSIZE bufsiz);
445 (
OSCTXT* pctxt, OSOCTET* bufaddr, OSSIZE bufsiz);
458 #define rtxCtxtGetMsgPtr(pctxt) (pctxt)->buffer.data 469 #define rtxCtxtGetMsgLen(pctxt) (pctxt)->buffer.byteIndex 554 #define rtxCtxtTestFlag(pctxt,mask) (((pctxt)->flags & mask) != 0) 571 (
OSCTXT* pctxt,
const OSUTF8CHAR* elemName, OSSIZE idx);
602 (
OSCTXT* pctxt,
const OSUTF8CHAR* elemName);
667 #define rtxCtxtPeekElemName(pctxt) \ 668 (((pctxt)->elemNameStack.count > 0) ? \ 669 (const OSUTF8CHAR*)(pctxt)->elemNameStack.tail->data : (const OSUTF8CHAR*)0) 756 EXTERNRT
int rtxPreInitContext (
OSCTXT* pctxt);
757 EXTERNRT
void rtxCtxtSetMemHeap (
OSCTXT* pctxt,
OSCTXT* pSrcCtxt);
783 #define rtxByteAlign(pctxt) \ 784 if ((pctxt)->buffer.bitOffset != 8) { \ 785 (pctxt)->buffer.byteIndex++; (pctxt)->buffer.bitOffset = 8; } 846 (
OSCTXT* pctxt,
char* buf, OSSIZE bufsiz);
861 #define rtxCtxtSetProtocolVersion(pctxt,value) (pctxt)->version = value 874 #define rtxMarkBitPos(pctxt,ppos,pbitoff) \ 875 (*(pbitoff) = (OSUINT8) (pctxt)->buffer.bitOffset, rtxMarkPos (pctxt, ppos)) 877 #define rtxResetToBitPos(pctxt,pos,bitoff) \ 878 ((pctxt)->buffer.bitOffset = (OSUINT8) bitoff, rtxResetToPos (pctxt, pos)) 881 #define RTXCTXTPUSHARRAYELEMNAME(pctxt,name,idx) \ 882 rtxCtxtPushArrayElemName(pctxt,OSUTF8(name),idx) 884 #define RTXCTXTPOPARRAYELEMNAME(pctxt) \ 885 rtxCtxtPopArrayElemName(pctxt) 887 #define RTXCTXTPUSHELEMNAME(pctxt,name) \ 888 rtxCtxtPushElemName(pctxt,OSUTF8(name)) 890 #define RTXCTXTPOPELEMNAME(pctxt) \ 891 rtxCtxtPopElemName(pctxt) 893 #define RTXCTXTPUSHTYPENAME(pctxt,name) \ 894 rtxCtxtPushTypeName(pctxt,OSUTF8(name)) 896 #define RTXCTXTPOPTYPENAME(pctxt) \ 897 rtxCtxtPopTypeName(pctxt) 899 #define RTXCTXTPUSHARRAYELEMNAME(pctxt,name,idx) 900 #define RTXCTXTPOPARRAYELEMNAME(pctxt) 901 #define RTXCTXTPUSHELEMNAME(pctxt,name) 902 #define RTXCTXTPOPELEMNAME(pctxt) 903 #define RTXCTXTPUSHTYPENAME(pctxt,name) 904 #define RTXCTXTPOPTYPENAME(pctxt) EXTERNRT const char * rtxCtxtGetExpDateStr(OSCTXT *pctxt, char *buf, OSSIZE bufsiz)
This function will get the license expiration date for a time-limited license.
EXTERNRT int rtxInitContext(OSCTXT *pctxt)
This function initializes an OSCTXT block.
int(* OSResetCtxtAppInfoPtr)(struct OSCTXT *pctxt)
OSRTResetCtxtAppInfoPtr is a pointer to pctxt->pAppInfo reset function, The pctxt->pAppInfo (pXMLInfo...
void(* OSFreeCtxtGlobalPtr)(struct OSCTXT *pctxt)
OSRTFreeCtxtGlobalPtr is a pointer to a memory free function.
EXTERNRT void rtxFreeContext(OSCTXT *pctxt)
This function frees all dynamic memory associated with a context.
EXTERNRT OSBOOL rtxCtxtContainerHasRemBits(OSCTXT *pctxt)
Return true iff there are bits remaining to be decoded in the current length-constrained container...
EXTERNRT OSBOOL rtxCtxtContainerEnd(OSCTXT *pctxt)
Return true if we are at the end of container - neither having more bits remaining nor having overrun...
OSRTStack containerEndIndexStack
Stack of OSBufferIndex, representing pointers to the end of currently open containers having length d...
EXTERNRT void rtxCtxtSetFlag(OSCTXT *pctxt, OSUINT32 mask)
This function is used to set a processing flag within the context structure.
EXTERNRT void rtxCtxtPopAllContainers(OSCTXT *pctxt)
Pop all containers from the container stack.
EXTERNRT OSBOOL rtxCtxtPopArrayElemName(OSCTXT *pctxt)
This function pops the last element name from the context stack.
This is the main list structure.
EXTERNRT void rtxMemHeapClearFlags(OSCTXT *pctxt, OSUINT32 flags)
This function clears memory heap flags.
EXTERNRT void rtxLicenseClose(void)
Finish with current license and free internal resources.
EXTERNRT int rtxInitContextUsingKey(OSCTXT *pctxt, const OSOCTET *key, OSSIZE keylen)
This function initializes a context using a run-time key.
EXTERNRT void rtxCtxtClearFlag(OSCTXT *pctxt, OSUINT32 mask)
This function is used to clear a processing flag within the context structure.
Structure to save the current message buffer state.
This structure can be used as an index into the buffer.
EXTERNRT const OSUTF8CHAR * rtxCtxtPopElemName(OSCTXT *pctxt)
This function pops the last element name from the context stack.
EXTERNRT OSSIZE rtxCtxtGetContainerRemBits(OSCTXT *pctxt)
Return the number of bits remaining to be decoded in the current length-constrained container...
EXTERNRT int rtxCtxtPushContainerBits(OSCTXT *pctxt, OSSIZE bits)
Notify the runtime layer of the start of decoding of a length-constrained container of a given length...
EXTERNRT int rtxInitThreadContext(OSCTXT *pctxt, const OSCTXT *pSrcCtxt)
This function initializes a context for use in a thread.
Run-time message buffer structure.
This structure is used to hold a single data item within the list.
EXTERNRT int rtxCheckContext(OSCTXT *pctxt)
This function verifies that the given context structure is initialized and ready for use...
Structure to hold information about a global PrintStream.
EXTERNRT int rtxCtxtSetBitOffset(OSCTXT *pctxt, OSSIZE offset)
This function sets the bit offset in the context to the given value.
EXTERNRT OSSIZE rtxCtxtGetIOByteCount(OSCTXT *pctxt)
This function returns the count of bytes either written to a stream or memory buffer.
EXTERNRT void rtxMemHeapSetFlags(OSCTXT *pctxt, OSUINT32 flags)
This function sets flags to a heap.
EXTERNRT int rtxCtxtPushElemNameCopy(OSCTXT *pctxt, const OSUTF8CHAR *elemName)
This function is used to push a copy of the given element name onto the context element name stack...
EXTERNRT void rtxCopyContext(OSCTXT *pdest, OSCTXT *psrc)
This function creates a copy of a context structure.
EXTERNRT int rtxCtxtPushContainerBytes(OSCTXT *pctxt, OSSIZE bytes)
Notify the runtime layer of the start of decoding of a length-constrained container of a given length...
Run-time error information structure.
EXTERNRT int rtxInitContextExt(OSCTXT *pctxt, OSMallocFunc malloc_func, OSReallocFunc realloc_func, OSFreeFunc free_func)
This function initializes an OSCTXT block.
EXTERNRT int rtxCtxtPushElemName(OSCTXT *pctxt, const OSUTF8CHAR *elemName)
This function is used to push an element name onto the context element name stack.
EXTERNRT void rtxCtxtPopElemNameCopy(OSCTXT *pctxt)
This function pops the last element name from the context stack and frees the associated memory...
EXTERNRT int rtxCtxtPushTypeName(OSCTXT *pctxt, const OSUTF8CHAR *typeName)
This function is used to push a type name onto the context element name stack.
EXTERNRT OSSIZE rtxCtxtGetBitOffset(OSCTXT *pctxt)
This function returns the total bit offset to the current element in the context buffer.
EXTERNRT int rtxCtxtPushArrayElemName(OSCTXT *pctxt, const OSUTF8CHAR *elemName, OSSIZE idx)
This function is used to push an array element name onto the context element name stack...
EXTERNRT int rtxCtxtMarkBitPos(OSCTXT *pctxt, OSSIZE *ppos)
This function saves the current bit position in a message buffer.
Run-time context structure.
EXTERNRT int rtxInitContextBuffer(OSCTXT *pctxt, OSOCTET *bufaddr, OSSIZE bufsiz)
This function assigns a message buffer to a context block.
The stream control block.
EXTERNRT void rtxCtxtPopContainer(OSCTXT *pctxt)
Notify the runtime layer of the end of decoding of a length-constrained container of the given length...
Run-time error location structure.
EXTERNRT int rtxCtxtResetToBitPos(OSCTXT *pctxt, OSSIZE pos)
This function resets a message buffer back to the given bit position.
Doubly-Linked List Utility Functions.
EXTERNRT const OSUTF8CHAR * rtxCtxtPopTypeName(OSCTXT *pctxt)
This function pops the type name from the context stack.
EXTERNRT int rtxCtxtSetBufPtr(OSCTXT *pctxt, OSOCTET *bufaddr, OSSIZE bufsiz)
This function is used to set the internal buffer pointer for in-memory encoding or decoding...
int(* OSFreeCtxtAppInfoPtr)(struct OSCTXT *pctxt)
OSRTFreeCtxtAppInfoPtr is a pointer to pctxt->pAppInfo free function, The pctxt->pAppInfo (pXMLInfo a...
EXTERNRT int rtxResetToPos(OSCTXT *pctxt, OSSIZE pos)
This function resets a message buffer or stream back to the given position.
EXTERNRT int rtxMarkPos(OSCTXT *pctxt, OSSIZE *ppos)
This function saves the current position in a message buffer or stream.