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

Google


Objective Systems, Inc.

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


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.


Functions

int xmlDecBitStr (ASN1CTXT *pctxt, ASN1OCTET *pvalue, ASN1UINT *pnbits, ASN1INT bufsize)
int xmlDecBool (ASN1CTXT *pctxt, ASN1BOOL *pvalue)
int xmlDecDynBitStr (ASN1CTXT *pctxt, ASN1DynBitStr *pvalue)
int xmlDecDynNamedBitStr (ASN1CTXT *pctxt, ASN1DynBitStr *pvalue, ASN1Const XmlNamedBitsDict *pBitDict)
int xmlDecDynOctStr (ASN1CTXT *pctxt, ASN1DynOctStr *pvalue)
int xmlDecGeneralizedTime (ASN1CTXT *pctxt, ASN1ConstCharPtr *outdata)
int xmlDecNamedBitStr (ASN1MemBuf *pMemBuf, ASN1OCTET *pData, int dataSize, ASN1UINT *pNumbits, ASN1Const XmlNamedBitsDict *pBitDict, ASN1Const XMLCHAR *chars, int length)
int xmlDecOctStr (ASN1CTXT *pctxt, ASN1OCTET *pvalue, ASN1UINT *pnocts, ASN1INT bufsize)
int xmlDecReal (ASN1CTXT *pctxt, ASN1REAL *pvalue)
int xmlDecUTCTime (ASN1CTXT *pctxt, ASN1ConstCharPtr *outdata)


Function Documentation

int xmlDecBitStr ASN1CTXT *  pctxt,
ASN1OCTET *  pvalue,
ASN1UINT *  pnbits,
ASN1INT  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 (ASN_OK) = success,
  • negative return value is error.

int xmlDecBool ASN1CTXT *  pctxt,
ASN1BOOL *  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 (ASN_OK) = success,
  • negative return value is error.

int xmlDecDynBitStr ASN1CTXT *  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 rtMemAlloc function.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

int xmlDecDynNamedBitStr ASN1CTXT *  pctxt,
ASN1DynBitStr *  pvalue,
ASN1Const 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 rtMemAlloc 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 (ASN_OK) = success,
  • negative return value is error.

int xmlDecDynOctStr ASN1CTXT *  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 rtMemAlloc function.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

int xmlDecGeneralizedTime ASN1CTXT *  pctxt,
ASN1ConstCharPtr *  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 rtMemAlloc function. It will contain time in ASN.1 format.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

int xmlDecNamedBitStr ASN1MemBuf *  pMemBuf,
ASN1OCTET *  pData,
int  dataSize,
ASN1UINT *  pNumbits,
ASN1Const XmlNamedBitsDict *  pBitDict,
ASN1Const 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 (ASN_OK) = success,
  • negative return value is error.

int xmlDecOctStr ASN1CTXT *  pctxt,
ASN1OCTET *  pvalue,
ASN1UINT *  pnocts,
ASN1INT  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 (ASN_OK) = success,
  • negative return value is error.

int xmlDecReal ASN1CTXT *  pctxt,
ASN1REAL *  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 rtMemAlloc function.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

int xmlDecUTCTime ASN1CTXT *  pctxt,
ASN1ConstCharPtr *  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 rtMemAlloc function. It will contain time in ASN.1 format.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.


Copyright © 1997-2005 Objective Systems,Inc.
All Rights Reserved.
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.

This file was last modified on 8 Sep 2005.
ASN1C XER Runtime, ASN1C v5.8x