XML C Decode Functions.
[XER Runtime Library Functions.]

Functions

int xmlDecBitStr (OSCTXT *pctxt, OSOCTET *pvalue, OSUINT32 *pnbits, OSINT32 bufsize)
int xmlDecBool (OSCTXT *pctxt, OSBOOL *pvalue)
int xmlDecDynBitStr (OSCTXT *pctxt, ASN1DynBitStr *pvalue)
int xmlDecDynNamedBitStr (OSCTXT *pctxt, ASN1DynBitStr *pvalue, const XmlNamedBitsDict *pBitDict)
int xmlDecDynOctStr (OSCTXT *pctxt, ASN1DynOctStr *pvalue)
int xmlDecGeneralizedTime (OSCTXT *pctxt, const char **outdata)
int xmlDecNamedBitStr (OSRTMEMBUF *pMemBuf, OSOCTET *pData, int dataSize, OSUINT32 *pNumbits, const XmlNamedBitsDict *pBitDict, const XMLCHAR *chars, int length)
int xmlDecOctStr (OSCTXT *pctxt, OSOCTET *pvalue, OSUINT32 *pnocts, OSINT32 bufsize)
int xmlDecReal (OSCTXT *pctxt, OSREAL *pvalue)
int xmlDecUTCTime (OSCTXT *pctxt, const char **outdata)

Detailed Description

XML runtime library decode functions handle the decoding of the primitive ASN.1 data types and length variables. Calls to these functions are assembled in the C source code generated by the ASN1C complier to decode complex ASN.1 structures. These functions are also directly callable from within a user's application program if the need to decode a primitive data item exists.


Function Documentation

int xmlDecBitStr ( OSCTXT *  pctxt,
OSOCTET *  pvalue,
OSUINT32 *  pnbits,
OSINT32  bufsize 
)

This function will decode a variable of the ASN.1 BIT STRING type into a static memory structure. This function call is generated by ASN1C to decode a sized bit production.

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.
pvalue A pointer to a variable to receive the decoded bit string. This is assumed to be a static array large enough to hold the number of octets specified in the bufsize input parameter.
pnbits A pointer to an integer value to receive the decoded number of bits.
bufsize An integer variable containing the size (in octets) of the sized ASN.1 bit string. An error will occur if the number of octets in the decoded string is larger than this value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecBool ( OSCTXT *  pctxt,
OSBOOL *  pvalue 
)

This function decodes a variable of the ASN.1 BOOLEAN type.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to a variable to receive the decoded BOOLEAN value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecDynBitStr ( OSCTXT *  pctxt,
ASN1DynBitStr *  pvalue 
)

This function will decode a variable of the ASN.1 BIT STRING type. 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.
pvalue A pointer to a dynamic bit string structure to receive the decoded bit string. Dynamic memory is allocated to hold the string using the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecDynNamedBitStr ( OSCTXT *  pctxt,
ASN1DynBitStr *  pvalue,
const XmlNamedBitsDict pBitDict 
)

This function will decode a list of identifiers into the array of octets. Identifiers should represent named bits value for BIT STRING. This function call is generated by ASN1C to decode a named bit production.

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.
pvalue A pointer to a dynamic bit string structure to receive the decoded bit string. Dynamic memory is allocated to hold the string using the rtxMemAlloc function.
pBitDict Bits' dictionary to be used to decode each bit. It is an array of name-value pairs, represented by an array of XmlNamedBitsDict structure.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecDynOctStr ( OSCTXT *  pctxt,
ASN1DynOctStr *  pvalue 
)

This function will decode a variable of the ASN.1 OCTET STRING type. 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.
pvalue A pointer to a dynamic bit string structure to receive the decoded bit string. Dynamic memory is allocated to hold the string using the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecGeneralizedTime ( OSCTXT *  pctxt,
const char **  outdata 
)

This function will decode a variable of the ASN.1 GeneralizedTime type. This function performs conversion between XML format of dateTime into the ASN.1 format. This function will allocate dynamic memory to store the 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.
outdata A pointer to a character string pointer variable to receive the decoded string. The string as stored as a standard null-terminated C string. Memory is allocated for the string by the rtxMemAlloc function. It will contain time in ASN.1 format.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecNamedBitStr ( OSRTMEMBUF *  pMemBuf,
OSOCTET *  pData,
int  dataSize,
OSUINT32 *  pNumbits,
const XmlNamedBitsDict pBitDict,
const XMLCHAR *  chars,
int  length 
)

This function will decode a list of identifiers into the array of octets. Identifiers should represent named bits value for BIT STRING. This function call is generated by ASN1C to decode a named bit production.

Parameters:
pMemBuf Pointer to the destination memory buffer.
pData A pointer to a variable to receive the decoded bit string. This is assumed to be a static array large enough to hold the number of octets specified in the bufsize input parameter.
dataSize An integer variable containing the size (in octets) of the sized ASN.1 bit string. An error will occur if the number of octets in the decoded string is larger than this value.
pNumbits A pointer to an integer value to receive the decoded number of bits.
pBitDict Bits' dictionary to be used to decode each bit. It is an array of name-value pairs, represented by an array of XmlNamedBitsDict structure.
chars XML data to be appended to memory buffer before parsing. Could be NULL, if it is final call to this function.
length Number of characters in XML data to be appended to memory buffer before parsing. Could be 0, if it is final call to this function.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecOctStr ( OSCTXT *  pctxt,
OSOCTET *  pvalue,
OSUINT32 *  pnocts,
OSINT32  bufsize 
)

This function will decode a variable of the ASN.1 OCTET STRING type into a static memory structure. This function call is generated by ASN1C to decode a sized octet string production.

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.
pvalue A pointer to a variable to receive the decoded bit string. This is assumed to be a static array large enough to hold the number of octets specified in the bufsize input parameter.
pnocts Pointer to an integer value to receive the number of octets.
bufsize An integer variable containing the size (in octets) of the sized ASN.1 octet string. An error will occur if the number of octets in the decoded string is larger than this value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecReal ( OSCTXT *  pctxt,
OSREAL *  pvalue 
)

This function will decode a variable of the ASN.1 32-bit character UniversalString type. This includes the UniversalString type.

Parameters:
pctxt A pointer to a context block structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pvalue A pointer to a structure variable to receive the decoded string. The string as stored as an array of unsigned integer characters. Memory is allocated for the string by the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int xmlDecUTCTime ( OSCTXT *  pctxt,
const char **  outdata 
)

This function will decode a variable of the ASN.1 UTCTime type. This function performs conversion between XML format of dateTime into the ASN.1 format. This function will allocate dynamic memory to store the 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.
outdata A pointer to a character string pointer variable to receive the decoded string. The string as stored as a standard null-terminated C string. Memory is allocated for the string by the rtxMemAlloc function. It will contain time in ASN.1 format.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.