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];
99 typedef OSUINT32 OSRTFLAGS;
126 #define OSDIAG 0x80000000 127 #define OSTRACE 0x40000000 128 #define OSDISSTRM 0x20000000 129 #define OSNOSTRMBACKOFF 0x08000000 130 #define OS3GMOBORIG 0x04000000 137 #define OSCONTCLOSED 0x02000000 138 #define OSRESERVED1 0x01000000 139 #define OSBUFSYSALLOC 0x00800000 170 #if !defined(OSCDECL) 171 #if defined(_MSC_VER) || defined(__BORLANDC__) 172 #define OSCDECL __cdecl 189 OSRTErrInfoList errInfo;
203 #ifndef _OS_NOPATTERN 222 OSVoidPtr pGlobalData;
223 struct OS3GPPSecParams* p3gppSec;
226 struct OSRTDiagBitFieldList* pBitFldList;
231 #define OSRT_GET_FIRST_ERROR_INFO(pctxt) \ 232 (((pctxt)->errInfo.list.head == 0) ? (OSRTErrInfo*)0 : \ 233 (OSRTErrInfo*)((pctxt)->errInfo.list.head->data)) 235 #define OSRT_GET_LAST_ERROR_INFO(pctxt) \ 236 (((pctxt)->errInfo.list.tail == 0) ? (OSRTErrInfo*)0 : \ 237 (OSRTErrInfo*)((pctxt)->errInfo.list.tail->data)) 244 #define OSRTISSTREAM(pctxt) \ 245 ((pctxt)->pStream != 0 && !((pctxt)->flags & OSDISSTRM)) 247 #define OSRTISBUFSTREAM(pctxt) \ 248 (OSRTISSTREAM(pctxt) && (0 != ((pctxt)->pStream->flags & OSRTSTRMF_BUFFERED))) 252 #define OSRTISSTREAM(pctxt) FALSE 253 #define OSRTISBUFSTREAM(pctxt) FALSE 257 #define OSRTBUFCUR(pctxt) (pctxt)->buffer.data[(pctxt)->buffer.byteIndex] 258 #define OSRTBUFPTR(pctxt) &(pctxt)->buffer.data[(pctxt)->buffer.byteIndex] 259 #define OSRTBUFFER(pctxt) (pctxt)->buffer.data 260 #define OSRTBUFSIZE(pctxt) (pctxt)->buffer.size 262 #define OSRTBUFSAVE(pctxt) { \ 263 (pctxt)->savedInfo.byteIndex = (pctxt)->buffer.byteIndex; \ 264 (pctxt)->savedInfo.flags = (pctxt)->flags; } 266 #define OSRTBUFSAVE2(pctxt,pSavedBuf) { \ 267 (pSavedBuf)->byteIndex = (pctxt)->buffer.byteIndex; \ 268 (pSavedBuf)->bitOffset = (pctxt)->buffer.bitOffset; \ 269 (pSavedBuf)->flags = (pctxt)->flags; } 271 #define OSRTBUFRESTORE(pctxt) { \ 272 (pctxt)->buffer.byteIndex = (pctxt)->savedInfo.byteIndex; \ 273 (pctxt)->flags = (pctxt)->savedInfo.flags; } 275 #define OSRTBUFRESTORE2(pctxt,pSavedBuf) { \ 276 (pctxt)->buffer.byteIndex = (pSavedBuf)->byteIndex; \ 277 (pctxt)->buffer.bitOffset = (pSavedBuf)->bitOffset; \ 278 (pctxt)->flags = (pSavedBuf)->flags; } 280 #define OSRTBYTEALIGNED(pctxt) \ 281 ((pctxt)->buffer.bitOffset == 8 || (pctxt)->buffer.bitOffset == 0) 285 typedef void *(OSCDECL *OSMallocFunc ) (OSSIZE size);
286 typedef void *(OSCDECL *OSReallocFunc) (
void *ptr, OSSIZE size);
287 typedef void (OSCDECL *OSFreeFunc ) (
void *ptr);
317 #ifndef rtxInitContext 336 OSMallocFunc malloc_func,
337 OSReallocFunc realloc_func,
338 OSFreeFunc free_func);
377 (
OSCTXT* pctxt,
const OSOCTET* key, OSSIZE keylen);
398 (
OSCTXT* pctxt, OSOCTET* bufaddr, OSSIZE bufsiz);
424 (
OSCTXT* pctxt, OSOCTET* bufaddr, OSSIZE bufsiz);
437 #define rtxCtxtGetMsgPtr(pctxt) (pctxt)->buffer.data 448 #define rtxCtxtGetMsgLen(pctxt) (pctxt)->buffer.byteIndex 533 #define rtxCtxtTestFlag(pctxt,mask) (((pctxt)->flags & mask) != 0) 550 (
OSCTXT* pctxt,
const OSUTF8CHAR* elemName, OSSIZE idx);
620 #define rtxCtxtPeekElemName(pctxt) \ 621 (((pctxt)->elemNameStack.count > 0) ? \ 622 (const OSUTF8CHAR*)(pctxt)->elemNameStack.tail->data : (const OSUTF8CHAR*)0) 709 EXTERNRT
int rtxPreInitContext (
OSCTXT* pctxt);
710 EXTERNRT
void rtxCtxtSetMemHeap (
OSCTXT* pctxt,
OSCTXT* pSrcCtxt);
736 #define rtxByteAlign(pctxt) \ 737 if ((pctxt)->buffer.bitOffset != 8) { \ 738 (pctxt)->buffer.byteIndex++; (pctxt)->buffer.bitOffset = 8; } 774 (
OSCTXT* pctxt,
char* buf, OSSIZE bufsiz);
789 #define rtxCtxtSetProtocolVersion(pctxt,value) (pctxt)->version = value 802 #define rtxMarkBitPos(pctxt,ppos,pbitoff) \ 803 (*(pbitoff) = (OSUINT8) (pctxt)->buffer.bitOffset, rtxMarkPos (pctxt, ppos)) 805 #define rtxResetToBitPos(pctxt,pos,bitoff) \ 806 ((pctxt)->buffer.bitOffset = (OSUINT8) bitoff, rtxResetToPos (pctxt, pos)) 809 #define RTXCTXTPUSHARRAYELEMNAME(pctxt,name,idx) \ 810 rtxCtxtPushArrayElemName(pctxt,OSUTF8(name),idx) 812 #define RTXCTXTPOPARRAYELEMNAME(pctxt) \ 813 rtxCtxtPopArrayElemName(pctxt) 815 #define RTXCTXTPUSHELEMNAME(pctxt,name) \ 816 rtxCtxtPushElemName(pctxt,OSUTF8(name)) 818 #define RTXCTXTPOPELEMNAME(pctxt) \ 819 rtxCtxtPopElemName(pctxt) 821 #define RTXCTXTPUSHTYPENAME(pctxt,name) \ 822 rtxCtxtPushTypeName(pctxt,OSUTF8(name)) 824 #define RTXCTXTPOPTYPENAME(pctxt) \ 825 rtxCtxtPopTypeName(pctxt) 827 #define RTXCTXTPUSHARRAYELEMNAME(pctxt,name,idx) 828 #define RTXCTXTPOPARRAYELEMNAME(pctxt) 829 #define RTXCTXTPUSHELEMNAME(pctxt,name) 830 #define RTXCTXTPOPELEMNAME(pctxt) 831 #define RTXCTXTPUSHTYPENAME(pctxt,name) 832 #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 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 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...
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.
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.