XBinder  Version 2.9.x
Classes | Macros | Typedefs | Functions
Context Management Functions

Context initialization functions handle the allocation, initialization, and destruction of context variables (variables of type OSCTXT). More...

Classes

struct  OSRTErrLocn
 Run-time error location structure. More...
 
struct  OSRTErrInfo
 Run-time error information structure. More...
 
struct  OSRTBuffer
 Run-time message buffer structure. More...
 
struct  OSRTBufSave
 Structure to save the current message buffer state. More...
 
struct  OSBufferIndex
 This structure can be used as an index into the buffer. More...
 
struct  OSCTXT
 Run-time context structure. More...
 

Macros

#define OSNOWHITESPACE   0x00400000 /* Turn off indentation whitesapce */
 Turn off unnecessary whitespace in text output. More...
 
#define rtxCtxtGetMsgPtr(pctxt)   (pctxt)->buffer.data
 This macro returns the start address of an encoded message. More...
 
#define rtxCtxtGetMsgLen(pctxt)   (pctxt)->buffer.byteIndex
 This macro returns the length of an encoded message. More...
 
#define rtxCtxtTestFlag(pctxt, mask)   (((pctxt)->flags & mask) != 0)
 This macro tests if the given bit flag is set in the context. More...
 
#define rtxCtxtPeekElemName(pctxt)
 This macro returns the last element name from the context stack. More...
 
#define rtxByteAlign(pctxt)
 This macro will byte-align the context buffer.
 
#define rtxCtxtSetProtocolVersion(pctxt, value)   (pctxt)->version = value
 This macro sets the protocol version in the context. More...
 

Typedefs

typedef int(* OSFreeCtxtAppInfoPtr) (struct OSCTXT *pctxt)
 OSRTFreeCtxtAppInfoPtr is a pointer to pctxt->pAppInfo free function, The pctxt->pAppInfo (pXMLInfo and pASN1Info) should contain the pointer to a structure and its first member should be a pointer to an appInfo free function.
 
typedef int(* OSResetCtxtAppInfoPtr) (struct OSCTXT *pctxt)
 OSRTResetCtxtAppInfoPtr is a pointer to pctxt->pAppInfo reset function, The pctxt->pAppInfo (pXMLInfo and pASN1Info) should contain the pointer to a structure and its second member should be a pointer to appInfo reset function.
 
typedef void(* OSFreeCtxtGlobalPtr) (struct OSCTXT *pctxt)
 OSRTFreeCtxtGlobalPtr is a pointer to a memory free function. More...
 

Functions

EXTERNRT int rtxInitContext (OSCTXT *pctxt)
 This function initializes an OSCTXT block. More...
 
EXTERNRT int rtxInitContextExt (OSCTXT *pctxt, OSMallocFunc malloc_func, OSReallocFunc realloc_func, OSFreeFunc free_func)
 This function initializes an OSCTXT block. More...
 
EXTERNRT int rtxInitThreadContext (OSCTXT *pctxt, const OSCTXT *pSrcCtxt)
 This function initializes a context for use in a thread. More...
 
EXTERNRT int rtxInitContextUsingKey (OSCTXT *pctxt, const OSOCTET *key, OSSIZE keylen)
 This function initializes a context using a run-time key. More...
 
EXTERNRT int rtxInitContextBuffer (OSCTXT *pctxt, OSOCTET *bufaddr, OSSIZE bufsiz)
 This function assigns a message buffer to a context block. More...
 
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. More...
 
EXTERNRT OSSIZE rtxCtxtGetBitOffset (OSCTXT *pctxt)
 This function returns the total bit offset to the current element in the context buffer. More...
 
EXTERNRT int rtxCtxtSetBitOffset (OSCTXT *pctxt, OSSIZE offset)
 This function sets the bit offset in the context to the given value. More...
 
EXTERNRT OSSIZE rtxCtxtGetIOByteCount (OSCTXT *pctxt)
 This function returns the count of bytes either written to a stream or memory buffer. More...
 
EXTERNRT int rtxCheckContext (OSCTXT *pctxt)
 This function verifies that the given context structure is initialized and ready for use. More...
 
EXTERNRT void rtxFreeContext (OSCTXT *pctxt)
 This function frees all dynamic memory associated with a context. More...
 
EXTERNRT void rtxCopyContext (OSCTXT *pdest, OSCTXT *psrc)
 This function creates a copy of a context structure. More...
 
EXTERNRT void rtxCtxtSetFlag (OSCTXT *pctxt, OSUINT32 mask)
 This function is used to set a processing flag within the context structure. More...
 
EXTERNRT void rtxCtxtClearFlag (OSCTXT *pctxt, OSUINT32 mask)
 This function is used to clear a processing flag within the context structure. More...
 
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. More...
 
EXTERNRT int rtxCtxtPushElemName (OSCTXT *pctxt, const OSUTF8CHAR *elemName)
 This function is used to push an element name onto the context element name stack. More...
 
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. More...
 
EXTERNRT int rtxCtxtPushTypeName (OSCTXT *pctxt, const OSUTF8CHAR *typeName)
 This function is used to push a type name onto the context element name stack. More...
 
EXTERNRT OSBOOL rtxCtxtPopArrayElemName (OSCTXT *pctxt)
 This function pops the last element name from the context stack. More...
 
EXTERNRT const OSUTF8CHAR * rtxCtxtPopElemName (OSCTXT *pctxt)
 This function pops the last element name from the context stack. More...
 
EXTERNRT void rtxCtxtPopElemNameCopy (OSCTXT *pctxt)
 This function pops the last element name from the context stack and frees the associated memory. More...
 
EXTERNRT const OSUTF8CHAR * rtxCtxtPopTypeName (OSCTXT *pctxt)
 This function pops the type name from the context stack. More...
 
EXTERNRT OSBOOL rtxCtxtContainerHasRemBits (OSCTXT *pctxt)
 Return true iff there are bits remaining to be decoded in the current length-constrained container, which is possibly the outer PDU. More...
 
EXTERNRT OSBOOL rtxCtxtContainerEnd (OSCTXT *pctxt)
 Return true if we are at the end of container - neither having more bits remaining nor having overrun it; otherwise return false. More...
 
EXTERNRT OSSIZE rtxCtxtGetContainerRemBits (OSCTXT *pctxt)
 Return the number of bits remaining to be decoded in the current length-constrained container, which is possibly the outer PDU. More...
 
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. More...
 
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. More...
 
EXTERNRT void rtxCtxtPopContainer (OSCTXT *pctxt)
 Notify the runtime layer of the end of decoding of a length-constrained container of the given length. More...
 
EXTERNRT void rtxCtxtPopAllContainers (OSCTXT *pctxt)
 Pop all containers from the container stack. More...
 
EXTERNRT void rtxMemHeapSetFlags (OSCTXT *pctxt, OSUINT32 flags)
 This function sets flags to a heap. More...
 
EXTERNRT void rtxMemHeapClearFlags (OSCTXT *pctxt, OSUINT32 flags)
 This function clears memory heap flags. More...
 
EXTERNRT int rtxCtxtMarkBitPos (OSCTXT *pctxt, OSSIZE *ppos)
 This function saves the current bit position in a message buffer. More...
 
EXTERNRT int rtxCtxtResetToBitPos (OSCTXT *pctxt, OSSIZE pos)
 This function resets a message buffer back to the given bit position. More...
 
EXTERNRT int rtxMarkPos (OSCTXT *pctxt, OSSIZE *ppos)
 This function saves the current position in a message buffer or stream. More...
 
EXTERNRT int rtxResetToPos (OSCTXT *pctxt, OSSIZE pos)
 This function resets a message buffer or stream back to the given position. More...
 
EXTERNRT const char * rtxCtxtGetExpDateStr (OSCTXT *pctxt, char *buf, OSSIZE bufsiz)
 This function will get the license expiration date for a time-limited license. More...
 
EXTERNRT void rtxLicenseClose (void)
 Finish with current license and free internal resources. More...
 

Detailed Description

Context initialization functions handle the allocation, initialization, and destruction of context variables (variables of type OSCTXT).

These variables hold all of the working data used during the process of encoding or decoding a message. The context provides thread safe operation by isolating what would otherwise be global variables within this structure. The context variable is passed from function to function as a message is encoded or decoded and maintains state information on the encoding or decoding process.

Macro Definition Documentation

◆ OSNOWHITESPACE

#define OSNOWHITESPACE   0x00400000 /* Turn off indentation whitesapce */

Turn off unnecessary whitespace in text output.

Currently, this affects Abstract Value Notation and JSON (JER) output.

Definition at line 150 of file rtxContext.h.

◆ rtxCtxtGetMsgLen

#define rtxCtxtGetMsgLen (   pctxt)    (pctxt)->buffer.byteIndex

This macro returns the length of an encoded message.

It will only work for in-memory encoding, not for encode to stream.

Note that this macro will not work with ASN.1 BER in-memory encoding. In this case, the BER-specific version of the function must be used.

Parameters
pctxtPointer to a context structure.

Definition at line 469 of file rtxContext.h.

◆ rtxCtxtGetMsgPtr

#define rtxCtxtGetMsgPtr (   pctxt)    (pctxt)->buffer.data

This macro returns the start address of an encoded message.

If a static buffer was used, this is simply the start address of the buffer. If dynamic encoding was done, this will return the start address of the dynamic buffer allocated by the encoder.

Note that this macro will not work with ASN.1 BER in-memory encoding. In this case, the BER-specific version of the function must be used.

Parameters
pctxtPointer to a context structure.

Definition at line 458 of file rtxContext.h.

◆ rtxCtxtPeekElemName

#define rtxCtxtPeekElemName (   pctxt)
Value:
(((pctxt)->elemNameStack.count > 0) ? \
(const OSUTF8CHAR*)(pctxt)->elemNameStack.tail->data : (const OSUTF8CHAR*)0)

This macro returns the last element name from the context stack.

Parameters
pctxtPointer to a context structure.
Returns
Element name from top of stack or NULL if stack is empty.

Definition at line 667 of file rtxContext.h.

◆ rtxCtxtSetProtocolVersion

#define rtxCtxtSetProtocolVersion (   pctxt,
  value 
)    (pctxt)->version = value

This macro sets the protocol version in the context.

This version number may be used in application code to do version specific operations. It is used in generated ASN.1 code with the extension addition version numbers to determine if an addition should be decoded.

For example, if this value is set to 8 and an extension addition group exists with version number 9 ([[ 9: ... ]]), its contents will not be decoded.

Parameters
pctxtPointer to a context structure.
valueThe version number value.

Definition at line 861 of file rtxContext.h.

◆ rtxCtxtTestFlag

#define rtxCtxtTestFlag (   pctxt,
  mask 
)    (((pctxt)->flags & mask) != 0)

This macro tests if the given bit flag is set in the context.

Parameters
pctxt- A pointer to a context structure.
mask- Bit flag to be tested

Definition at line 554 of file rtxContext.h.

Typedef Documentation

◆ OSFreeCtxtGlobalPtr

typedef void(* OSFreeCtxtGlobalPtr) (struct OSCTXT *pctxt)

OSRTFreeCtxtGlobalPtr is a pointer to a memory free function.

This type describes the custom global memory free function generated by the compiler to free global nmemory. A pointer to a function of this type may be stored in the context gblFreeFunc field in order to free global data (pGlobalData) when rtxFreeContext is called.

Definition at line 176 of file rtxContext.h.

Function Documentation

◆ rtxCheckContext()

EXTERNRT int rtxCheckContext ( OSCTXT pctxt)

This function verifies that the given context structure is initialized and ready for use.

Parameters
pctxtPointer to a context structure.
Returns
Completion status of operation:
  • 0 = success,
  • RTERR_NOTINIT status code if not initialized

◆ rtxCopyContext()

EXTERNRT void rtxCopyContext ( OSCTXT pdest,
OSCTXT psrc 
)

This function creates a copy of a context structure.

The copy is a "shallow copy" (i.e. new copies of dynamic memory blocks held within the context are not made, only the pointers are transferred to the new context structure). This function is mainly for use from within compiler-generated code.

Parameters
pdest- Context structure to which data is to be copied.
psrc- Context structure from which data is to be copied.

◆ rtxCtxtClearFlag()

EXTERNRT void rtxCtxtClearFlag ( OSCTXT pctxt,
OSUINT32  mask 
)

This function is used to clear a processing flag within the context structure.

Parameters
pctxt- A pointer to a context structure.
mask- Mask containing bit(s) to be cleared.

◆ rtxCtxtContainerEnd()

EXTERNRT OSBOOL rtxCtxtContainerEnd ( OSCTXT pctxt)

Return true if we are at the end of container - neither having more bits remaining nor having overrun it; otherwise return false.

Overflowing the container should only be possible when a container length has been pushed onto the container stack, since the runtime doesn't allow going beyond the end of the buffer.

See also rtxCtxtPushContainer(Bits|Bytes)/rtxCtxtPopContainer

Parameters
pctxtPointer to context structure.

◆ rtxCtxtContainerHasRemBits()

EXTERNRT OSBOOL rtxCtxtContainerHasRemBits ( OSCTXT pctxt)

Return true iff there are bits remaining to be decoded in the current length-constrained container, which is possibly the outer PDU.

See also rtxCtxtPushContainer(Bits|Bytes)/rtxCtxtPopContainer

Parameters
pctxtPointer to context structure.

◆ rtxCtxtGetBitOffset()

EXTERNRT OSSIZE rtxCtxtGetBitOffset ( OSCTXT pctxt)

This function returns the total bit offset to the current element in the context buffer.

Parameters
pctxtPointer to a context structure.
Returns
Bit offset.

◆ rtxCtxtGetContainerRemBits()

EXTERNRT OSSIZE rtxCtxtGetContainerRemBits ( OSCTXT pctxt)

Return the number of bits remaining to be decoded in the current length-constrained container, which is possibly the outer PDU.

See also rtxCtxtPushContainer(Bits|Bytes)/rtxCtxtPopContainer

Parameters
pctxtPointer to context structure.

◆ rtxCtxtGetExpDateStr()

EXTERNRT const char* rtxCtxtGetExpDateStr ( OSCTXT pctxt,
char *  buf,
OSSIZE  bufsiz 
)

This function will get the license expiration date for a time-limited license.

Parameters
pctxtPointer to a context block.
bufBuffer to receive date string.
bufsizSize of the buffer.
Returns
Pointer to character string if successful (will be point to buf) or null if no expiration date was found.

◆ rtxCtxtGetIOByteCount()

EXTERNRT OSSIZE rtxCtxtGetIOByteCount ( OSCTXT pctxt)

This function returns the count of bytes either written to a stream or memory buffer.

Parameters
pctxtPointer to a context structure.
Returns
I/O byte count.

◆ rtxCtxtMarkBitPos()

EXTERNRT int rtxCtxtMarkBitPos ( OSCTXT pctxt,
OSSIZE *  ppos 
)

This function saves the current bit position in a message buffer.

Parameters
pctxtPointer to a context block.
pposPointer to saved position.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxCtxtPopAllContainers()

EXTERNRT void rtxCtxtPopAllContainers ( OSCTXT pctxt)

Pop all containers from the container stack.

This is useful for clearing the stack when an error has occured. It is invoked automatically by rtxErrReset.

Parameters
pctxtPointer to context structure.

◆ rtxCtxtPopArrayElemName()

EXTERNRT OSBOOL rtxCtxtPopArrayElemName ( OSCTXT pctxt)

This function pops the last element name from the context stack.

This name is assumed to be an array element name pushed by the rtxCtxtPushArrayElemName function. The name is therefore dynamic and memory is freed for it using the rtxMemFreePtr function.

Parameters
pctxtPointer to a context structure.
Returns
True if name popped from stack or false if stack is empty.

◆ rtxCtxtPopContainer()

EXTERNRT void rtxCtxtPopContainer ( OSCTXT pctxt)

Notify the runtime layer of the end of decoding of a length-constrained container of the given length.

This method should be called when the final bit to be decoded has been decoded.

This pops an entry off of pctxt->containerEndIndex

Parameters
pctxtPointer to context structure.

◆ rtxCtxtPopElemName()

EXTERNRT const OSUTF8CHAR* rtxCtxtPopElemName ( OSCTXT pctxt)

This function pops the last element name from the context stack.

Parameters
pctxtPointer to a context structure.
Returns
Element name popped from stack or NULL if stack is empty.

◆ rtxCtxtPopElemNameCopy()

EXTERNRT void rtxCtxtPopElemNameCopy ( OSCTXT pctxt)

This function pops the last element name from the context stack and frees the associated memory.

It is assumed it was added to the stack using the rtxCtxtPushElemNameCopy function.

Parameters
pctxtPointer to a context structure.

◆ rtxCtxtPopTypeName()

EXTERNRT const OSUTF8CHAR* rtxCtxtPopTypeName ( OSCTXT pctxt)

This function pops the type name from the context stack.

The name is only popped if the item count is one.

Parameters
pctxtPointer to a context structure.
Returns
Type name popped from stack or NULL if stack count not equal to one.

◆ rtxCtxtPushArrayElemName()

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.

The name is formed by combining the given element name with the index to create a name of format name[index]. Dynamic memory is allocated for the resulting name using the rtxMemAlloc function.

Parameters
pctxtPointer to a context structure.
elemNameName of element to be pushed on stack.
idxIndex or the array element.
Returns
Completion status of operation:
  • 0 = success,
  • RTERR_NOMEM if mem alloc for name fails.

◆ rtxCtxtPushContainerBits()

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.

This method should be called when the next bit to be decoded is the first bit of the length-constrained content.

This pushes an entry onto pctxt->containerEndIndex.

Parameters
pctxtPointer to context structure.
bitsNumber of bits in the length-constrained container.
Returns
Completion status of operation:
  • zero (0) = success,
  • negative return value is error.

◆ rtxCtxtPushContainerBytes()

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.

This method should be called when the next bit to be decoded is the first bit of the length-constrained content.

This pushes an entry onto pctxt->containerEndIndex.

Parameters
pctxtPointer to context structure.
bytesNumber of bytes of the length-constrained container.
Returns
Completion status of operation:
  • zero (0) = success,
  • negative return value is error.

◆ rtxCtxtPushElemName()

EXTERNRT int rtxCtxtPushElemName ( OSCTXT pctxt,
const OSUTF8CHAR *  elemName 
)

This function is used to push an element name onto the context element name stack.

Parameters
pctxtPointer to a context structure.
elemNameName of element to be pushed on stack. Note that a copy of the name is not made, the pointer to the name that is passed is stored.
Returns
Completion status of operation:
  • 0 = success,
  • RTERR_NOMEM if mem alloc for list element fails.

◆ rtxCtxtPushElemNameCopy()

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.

A copy of the element name is made using context memory management. The name should be popped using the rtxCtxtPopElemNameCopy function to ensure memory is freed.

Parameters
pctxtPointer to a context structure.
elemNameName of element to be pushed on stack. A copy of the name is made.
Returns
Completion status of operation:
  • 0 = success,
  • RTERR_NOMEM if mem alloc for name or list element fails.

◆ rtxCtxtPushTypeName()

EXTERNRT int rtxCtxtPushTypeName ( OSCTXT pctxt,
const OSUTF8CHAR *  typeName 
)

This function is used to push a type name onto the context element name stack.

The name is only added for the top-level type. This is determined by testing to ensure that there are no existing names on the stack.

Parameters
pctxtPointer to a context structure.
typeNameName of type to be pushed on stack. Note that a copy of the name is not made, the pointer to the name that is passed is stored.
Returns
Completion status of operation:
  • 0 = success,
  • RTERR_NOMEM if mem alloc for name fails.

◆ rtxCtxtResetToBitPos()

EXTERNRT int rtxCtxtResetToBitPos ( OSCTXT pctxt,
OSSIZE  pos 
)

This function resets a message buffer back to the given bit position.

Parameters
pctxtPointer to a context block.
posContext position.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxCtxtSetBitOffset()

EXTERNRT int rtxCtxtSetBitOffset ( OSCTXT pctxt,
OSSIZE  offset 
)

This function sets the bit offset in the context to the given value.

Parameters
pctxtPointer to a context structure.
offsetBit offset.
Returns
Completion status of operation:
  • 0 = success,
  • Negative status code if error

◆ rtxCtxtSetBufPtr()

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.

It must be called after the context variable is initialized before any other compiler generated or run-time library encode function.

Parameters
pctxtPointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
bufaddrA pointer to a memory buffer to use to encode a message or that holds a message to be decoded. The buffer should be declared as an array of unsigned characters (OCTETs). This parameter can be set to NULL to specify dynamic encoding (i.e., the encode functions will dynamically allocate a buffer to hold the encoded message).
bufsizThe length of the memory buffer in bytes. Should be set to zero if NULL was specified for bufaddr (i.e. dynamic encoding was selected).

◆ rtxCtxtSetFlag()

EXTERNRT void rtxCtxtSetFlag ( OSCTXT pctxt,
OSUINT32  mask 
)

This function is used to set a processing flag within the context structure.

Parameters
pctxt- A pointer to a context structure.
mask- Mask containing bit(s) to be set.

◆ rtxFreeContext()

EXTERNRT void rtxFreeContext ( OSCTXT pctxt)

This function frees all dynamic memory associated with a context.

This includes all memory allocated using the rtxMem functions using the given context parameter.

Parameters
pctxtPointer to a context structure.

◆ rtxInitContext()

EXTERNRT int rtxInitContext ( OSCTXT pctxt)

This function initializes an OSCTXT block.

It sets all key working parameters to their correct initial state values. It is required that this function be invoked before using a context variable.

NOTE: This as part of the common runtime, this is not intended to be called directly by user code; it does not initialize application-specific data structures (e.g. those used for ASN.1). If you are a user reading this, you may instead be interested in rtInitContext.

Parameters
pctxtPointer to the context structure variable to be initialized.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxInitContextBuffer()

EXTERNRT int rtxInitContextBuffer ( OSCTXT pctxt,
OSOCTET *  bufaddr,
OSSIZE  bufsiz 
)

This function assigns a message buffer to a context block.

The block should have been previously initialized by rtxInitContext.

Parameters
pctxtThe pointer to the context structure variable to be initialized.
bufaddrFor encoding, the address of a memory buffer to receive the encoded message. If this address is NULL (0), encoding to a dynamic buffer will be done. For decoding, the address of a buffer that contains the message data to be decoded.
bufsizThe size of the memory buffer. For encoding, this argument may be set to zero to indicate a dynamic memory buffer should be used.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxInitContextExt()

EXTERNRT int rtxInitContextExt ( OSCTXT pctxt,
OSMallocFunc  malloc_func,
OSReallocFunc  realloc_func,
OSFreeFunc  free_func 
)

This function initializes an OSCTXT block.

It sets all key working parameters to their correct initial state values. It is required that this function be invoked before using a context variable.

Parameters
pctxtPointer to the context structure variable to be initialized.
malloc_funcPointer to the memory allocation function.
realloc_funcPointer to the memory reallocation function.
free_funcPointer to the memory deallocation function.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxInitContextUsingKey()

EXTERNRT int rtxInitContextUsingKey ( OSCTXT pctxt,
const OSOCTET *  key,
OSSIZE  keylen 
)

This function initializes a context using a run-time key.

This form is required for evaluation and limited distribution software. The compiler will generate a macro for rtXmlInitContext in the rtkey.h file that will invoke this function with the generated run-time key.

Parameters
pctxtThe pointer to the context structure variable to be initialized.
keyKey data generated by ASN1C compiler.
keylenKey data field length.
Returns
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

◆ rtxInitThreadContext()

EXTERNRT int rtxInitThreadContext ( OSCTXT pctxt,
const OSCTXT pSrcCtxt 
)

This function initializes a context for use in a thread.

It is the same as rtxInitContext except that it copies the pointer to constant data from the given source context into the newly initialized thread context. It is assumed that the source context has been initialized and the custom generated global initialization function has been called. The main purpose of this function is to prevent multiple copies of global static data from being created within different threads.

Parameters
pctxtPointer to the context structure variable to be initialized.
pSrcCtxtPointer to source context which has been fully initialized including a pointer to global constant data initialized via a call to a generated 'Init_<project>_Global' function.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxLicenseClose()

EXTERNRT void rtxLicenseClose ( void  )

Finish with current license and free internal resources.

To avoid crashing your application:

  • Do not call this during an exit handler function registered with atexit().
  • Do not call this when another thread might concurrently trigger a license check by invoking methods in the asn1c runtime.

◆ rtxMarkPos()

EXTERNRT int rtxMarkPos ( OSCTXT pctxt,
OSSIZE *  ppos 
)

This function saves the current position in a message buffer or stream.

Note that this saves the byte offset only and does not consider the bit position. Therefore, it may not be suitable for use with the packed encoding rules (see rtxMarkBitPos).

Parameters
pctxtPointer to a context block.
pposPointer to saved position.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxMemHeapClearFlags()

EXTERNRT void rtxMemHeapClearFlags ( OSCTXT pctxt,
OSUINT32  flags 
)

This function clears memory heap flags.

Parameters
pctxtPointer to a memory block structure that contains the list of dynamic memory block maintained by these functions.
flagsThe flags

◆ rtxMemHeapSetFlags()

EXTERNRT void rtxMemHeapSetFlags ( OSCTXT pctxt,
OSUINT32  flags 
)

This function sets flags to a heap.

May be used to control the heap's behavior.

Parameters
pctxtPointer to a memory block structure that contains the list of dynamic memory block maintained by these functions.
flagsThe flags.

◆ rtxResetToPos()

EXTERNRT int rtxResetToPos ( OSCTXT pctxt,
OSSIZE  pos 
)

This function resets a message buffer or stream back to the given position.

Parameters
pctxtPointer to a context block.
posContext position.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.