XER C Utility Functions.
[XER Runtime Library Functions.]

Functions

OSBOOL xerCmpText (const XMLCHAR *text1, const char *text2)
int xerCopyText (OSCTXT *pctxt, const char *text)
int xerTextLength (const XMLCHAR *text)
const char * xerTextToCStr (OSCTXT *pctxt, const XMLCHAR *text)
size_t xerGetMsgLen (OSCTXT *pctxt)
OSOCTET * xerGetMsgPtr (OSCTXT *pctxt)
int xerGetElemIdx (const XMLCHAR *elemName, XerElemInfo *pElemInfo, int numElems)
int xerGetSeqElemIdx (const XMLCHAR *elemName, XerElemInfo *pElemInfo, int numElems, int startIndex)
int xerFinalizeMemBuf (OSRTMEMBUF *pMemBuf)
int xerGetLibVersion (OSVOIDARG)
const char * xerGetLibInfo (OSVOIDARG)

Detailed Description

The XER utility functions are common routines used by both XER encode and decode functions.


Function Documentation

OSBOOL xerCmpText ( const XMLCHAR *  text1,
const char *  text2 
)

This function is used to compare two strings: the first is represented as a 16-bit character null-terminated string and the second is represented as an 8-bit standard null-terminated string.

Parameters:
text1 A pointer to a 16-bit character null-terminated string.
text2 A pointer to an 8-bit character null-terminated string.
Returns:
The result of the comparison: TRUE, if strings match, otherwise FALSE.
const char* xerGetLibInfo ( OSVOIDARG   ) 

Returns information string describing the library. The string contains name of library, its version and flags used for building the library.

Returns:
Information string
int xerGetLibVersion ( OSVOIDARG   ) 

Returns numeric version of run-time library. The format of version is as follows: MmP, where: M - major version number; m - minor version number; p - patch release number. For example, the value 581 means the version 5.81.

Returns:
Version of run-time library in numeric format.
size_t xerGetMsgLen ( OSCTXT *  pctxt  ) 

This function is used to get the encoded message length.

Parameters:
pctxt A pointer to a context structure.
Returns:
The length of a message in the buffer.
OSOCTET* xerGetMsgPtr ( OSCTXT *  pctxt  ) 

This function is used to obtain a pointer to the start of an encoded message. This function is called after a complier generated encode function to get the pointer to the start of the encoded message. It is normally used when dynamic encoding is specified because the message pointer is not known until the encoding is complete. If static encoding is used, the message starts at the beginning of the specified buffer and the xerGetMsgLen function can be used to obtain the length of the message.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
Returns:
A pointer to the beginning of the encoded message.
int xerTextLength ( const XMLCHAR *  text  ) 

This function returns the length of a 16-bit character null-terminated string.

Parameters:
text A pointer to a 16-bit character null-terminated string.
const char* xerTextToCStr ( OSCTXT *  pctxt,
const XMLCHAR *  text 
)

This function converts a 16-bit character string to a standard null-terminated C-string. This function will allocate dynamic memory to store the decoded result.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
text A pointer to a 16-bit character null-terminated string.
Returns:
The resulting C string. The memory is allocated by using rtxMemAlloc function.