Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

Context Management Functions


Classes

struct  OSBuffer
 Run-time message buffer structure. More...

struct  OSErrLocn
 Run-time error location structure. More...

struct  OSErrInfo
 Run-time error information structure. More...

struct  OSBufSave
 Structure to save the current message buffer state. More...

struct  OSCTXT
 Run-time context structure. More...

struct  OSBuffer
 Run-time message buffer structure. More...

struct  OSErrLocn
 Run-time error location structure. More...

struct  OSErrInfo
 Run-time error information structure. More...

struct  OSBufSave
 Structure to save the current message buffer state. More...

struct  OSCTXT
 Run-time context structure. More...


Defines

#define OSERRSTKSIZ   8 /* error stack size */
#define OSMAXERRPRM   5 /* maximum error parameters */

Typedefs

typedef OSCTXT OSCTXT
typedef int(* OSFreeCtxtAppInfoPtr )(OSCTXT *pctxt)
 OSFreeCtxtAppInfoPtr is a pointer to pctxt->pAppInfo free function, The pctxt->pAppInfo should contain the pointer to a structure and its first member should be a pointer to appInfo free function.


Functions

int rtxInitContext (OSCTXT *pctxt)
 This function initializes an OSCTXT block.

int rtxInitContextBuffer (OSCTXT *pctxt, const OSOCTET *bufaddr, OSUINT32 bufsiz)
 This function assigns a message buffer to a context block.

void rtxFreeContext (OSCTXT *pctxt)
 This function frees all dynamic memory associated with a context.

void rtxCopyContext (OSCTXT *pdest, OSCTXT *psrc)
 This function creates a copy of a context structure.

void rtxCtxtSetFlag (OSCTXT *pctxt, OSUINT16 mask)
 This function is used to set a processing flag within the context structure.

void rtxCtxtClearFlag (OSCTXT *pctxt, OSUINT16 mask)
 This function is used to clear a processing flag within the context structure.


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.

Function Documentation

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.

void rtxCtxtClearFlag OSCTXT pctxt,
OSUINT16  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.

void rtxCtxtSetFlag OSCTXT pctxt,
OSUINT16  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.

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:
pctxt - A pointer to a context structure.

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.

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

int rtxInitContextBuffer OSCTXT pctxt,
const OSOCTET *  bufaddr,
OSUINT32  bufsiz
 

This function assigns a message buffer to a context block.

The block should have been previously initialized by rtInitContext.

Parameters:
pctxt The pointer to the context structure variable to be initialized.
bufaddr For 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.
bufsiz The 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.


This file was last modified on 1 Jun 2004.
XBinder, Version 1.0.0