|
|
 |
 |
|
Detailed Description
The XER low-level encode functions handle the XER encoding of primitive ASN.1 data types. Calls to these functions are assembled in the C source code generated by the ASN1C complier to accomplish the encoding of complex ASN.1 structures. These functions are also directly callable from within a user's application program if the need to accomplish a low level encoding function exists.
The procedure to call a low-level encode function is the same as the procedure to call a complier generated encode function described above. The rtInitContext and xerSetEncBufPtr functions must first be called to initialize a context and set a pointer to a buffer into which the variable is to be encoded. A static encode buffer is spcified by specifying a pointer to a buffer and buffer size. Setting the buffer address to NULL and buffer size to 0 specifies a dynamic buffer. The encode function is then invoked. The result of the encoding will start at the beginning of the specified buffer, or, if a dynamic buffer was used, it can be obtained by calling xerGetMsgPtr. The length of the encoded component is obtained by calling xerGetMsgLen.
|
Functions |
| int | xerSetEncBufPtr (ASN1CTXT *pCtxt, ASN1OCTET *bufaddr, size_t bufsiz, ASN1BOOL canonical) |
| int | xerEncAscCharStr (ASN1CTXT *pctxt, ASN1ConstCharPtr value, ASN1ConstCharPtr elemName) |
| int | xerEncBase64Str (ASN1CTXT *pctxt, ASN1UINT nocts, ASN1ConstOctetPtr data, ASN1ConstCharPtr elemName) |
| int | xerEncBigInt (ASN1CTXT *pctxt, ASN1ConstCharPtr value, ASN1ConstCharPtr elemName) |
| int | xerEncBitStr (ASN1CTXT *pctxt, ASN1UINT nbits, ASN1ConstOctetPtr data, ASN1ConstCharPtr elemName, ASN1StrType outputType) |
|
int | xerEncBoolValue (ASN1CTXT *pctxt, ASN1BOOL value) |
| int | xerEncBool (ASN1CTXT *pctxt, ASN1BOOL value, ASN1ConstCharPtr elemName) |
| int | xerEncEndDocument (ASN1CTXT *pctxt) |
| int | xerEncEndElement (ASN1CTXT *pctxt, ASN1ConstCharPtr elemName) |
| int | xerEncIndent (ASN1CTXT *pctxt) |
| int | xerEncInt (ASN1CTXT *pctxt, ASN1INT value, ASN1ConstCharPtr elemName) |
| int | xerEncInt64 (ASN1CTXT *pctxt, ASN1INT64 value, ASN1ConstCharPtr elemName) |
| int | xerEncNewLine (ASN1CTXT *pctxt) |
| int | xerEncObjId (ASN1CTXT *pctxt, const ASN1OBJID *pvalue, ASN1ConstCharPtr elemName) |
| int | xerEncObjId64 (ASN1CTXT *pctxt, const ASN1OID64 *pvalue, ASN1ConstCharPtr elemName) |
| int | xerEncRelativeOID (ASN1CTXT *pctxt, const ASN1OBJID *pvalue, ASN1ConstCharPtr elemName) |
| int | xerEncOctStr (ASN1CTXT *pctxt, ASN1UINT nocts, ASN1ConstOctetPtr data, ASN1ConstCharPtr elemName) |
| int | xerEncReal (ASN1CTXT *pctxt, ASN1REAL value, ASN1ConstCharPtr elemName) |
| int | xerEncStartDocument (ASN1CTXT *pctxt) |
| int | xerEncStartElement (ASN1CTXT *pctxt, ASN1ConstCharPtr elemName, ASN1ConstCharPtr attributes) |
| int | xerEncEmptyElement (ASN1CTXT *pctxt, ASN1ConstCharPtr elemName, ASN1ConstCharPtr attributes) |
| int | xerEncNamedValue (ASN1CTXT *pctxt, ASN1ConstCharPtr value, ASN1ConstCharPtr elemName, ASN1ConstCharPtr attributes) |
| int | xerEncUInt (ASN1CTXT *pctxt, ASN1UINT value, ASN1ConstCharPtr elemName) |
| int | xerEncUInt64 (ASN1CTXT *pctxt, ASN1UINT64 value, ASN1ConstCharPtr elemName) |
| int | xerEncBMPStr (ASN1CTXT *pctxt, const ASN1BMPString *value, ASN1ConstCharPtr elemName) |
| int | xerEncUnivStr (ASN1CTXT *pctxt, const ASN1UniversalString *value, ASN1ConstCharPtr elemName) |
| int | xerEncUniCharData (ASN1CTXT *pctxt, ASN1Const16BitCharPtr value, ASN1UINT nchars) |
| int | xerEncUniCharStr (ASN1CTXT *pctxt, ASN116BITCHAR *value, ASN1ConstCharPtr elemName) |
| int | xerEncOpenType (ASN1CTXT *pctxt, ASN1UINT nocts, ASN1ConstOctetPtr data, ASN1ConstCharPtr elemName) |
| int | xerEncNull (ASN1CTXT *pctxt, ASN1ConstCharPtr elemName) |
|
int | xerEncXmlCharData (ASN1CTXT *pctxt, ASN1Const XMLCHAR *pvalue, int length) |
Function Documentation
| int xerEncAscCharStr |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable one of the ASN.1 character string types that are based on 8-bit character sets. This includes IA5Sring, VisibleString, PrintableString, and UTF8String, and NumericString.
- 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. |
| value | A pointer to a null-terminated C character string to be encoded. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncBase64Str |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1UINT |
nocts, |
|
|
ASN1ConstOctetPtr |
data, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 OCTET STRING type using Base64 encoding.
- 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. |
| nocts | The number of octets (bytes) within the OCTET STRING to be encoded. |
| data | A pointer to an OCTET STRING containing the octet data to be encoded. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type is (<OCTET_STRING>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncBigInt |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 INTEGER type. In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits). For example, parameters used to calculate security values are typically larger than these sizes.
Items of this type are stored in character string constant variables. They can be represented as decimal strings (with no prefixes), as hexadecimal strings starting with a "0x" prefix, as octal strings starting with a "0o" prefix or as binary strings starting with a "0b" prefix. Other radixes are currently not supported.
- Parameters:
-
| pctxt | Pointer to context block structure. |
| value | A pointer to a character string containing the value to be encoded. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<INTEGER>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncBitStr |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1UINT |
nbits, |
|
|
ASN1ConstOctetPtr |
data, |
|
|
ASN1ConstCharPtr |
elemName, |
|
|
ASN1StrType |
outputType |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 BIT STRING type.
- 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. |
| nbits | The number of bits within the bit string to be encoded. |
| data | A pointer to an OCTET string containing the bit data to be encoded. This string contains bytes having the actual bit settings as they are to be encoded in the message. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<BIT_STRING>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
| outputType | An enumerated type whose value is set to either 'ASN1BIN' (for binary format) or 'ASN1HEX' (for hexadecimal format). |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncBMPStr |
( |
ASN1CTXT * |
pctxt, |
|
|
const ASN1BMPString * |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the BMPString ASN.1 character string type.
- 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. |
| value | A pointer to a structure representing a 16-bit character string to encoded. This structure contains a character count element and a pointer to an array of 16-bit character elements represented as 16-bit short integers. |
| elemName | A pointer to a name of an element. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncBool |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1BOOL |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 BOOLEAN type.
- 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. |
| value | A BOOLEAN value to be encoded. A BOOLEAN is defined as a single octet whose value is 0 for False and any other value for TRUE. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<BOOLEAN>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncEmptyElement |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr |
elemName, |
|
|
ASN1ConstCharPtr |
attributes |
|
) |
|
|
|
|
This function encodes an empty element, such as <element/>.
- 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. |
| elemName | A pointer to the name of the element. |
| attributes | A pointer to the attributes of the element. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncEndDocument |
( |
ASN1CTXT * |
pctxt |
) |
|
|
|
|
This function should be called at the end of the document's encoding.
- 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:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncEndElement |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes the ending tag of the XML element, such as </element>.
- 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. |
| elemName | A pointer to the name of the element. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncIndent |
( |
ASN1CTXT * |
pctxt |
) |
|
|
|
|
- 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. |
|
| int xerEncInt |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1INT |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 INTEGER type.
- 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. |
| value | An INTEGER value to be encoded. The ASN1INT type is set to the C type 'int' in the asn1type.h file. This is assumed to represent a 32-bit integer value. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<INTEGER>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncInt64 |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1INT64 |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a 64-bit variable of the ASN.1 INTEGER type.
- 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. |
| value | A 64-bit INTEGER value to be encoded. The ASN1INT64 type is set to the C type '__int64', 'long long' or 'long' in the asn1type.h file (depends on the used platform and the compiler). This is assumed to represent a 64-bit integer value. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<INTEGER>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncNamedValue |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr |
value, |
|
|
ASN1ConstCharPtr |
elemName, |
|
|
ASN1ConstCharPtr |
attributes |
|
) |
|
|
|
|
This function encodes a named value, for example an enumerated value, such as <element><value/></element>.
- 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. |
| value | A pointer to a value string |
| elemName | A pointer to the name of the element. |
| attributes | A pointer to the attributes of the element. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncNewLine |
( |
ASN1CTXT * |
pctxt |
) |
|
|
|
|
This function inserts a new line symbol int the XML document.
- 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:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncNull |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes an ASN.1 NULL placeholder. In XER the NULL value is represented as an empty element, such as <null/>.
- 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. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If a null or empty string is passes (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncObjId |
( |
ASN1CTXT * |
pctxt, |
|
|
const ASN1OBJID * |
pvalue, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 OBJECT IDENTIFIER type.
- 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 an object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array to hold the subidentifier values. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<OBJECT_IDENTIFIER>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncObjId64 |
( |
ASN1CTXT * |
pctxt, |
|
|
const ASN1OID64 * |
pvalue, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 OBJECT IDENTIFIER type using 64-bit subidentifiers.
- 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 64-bit object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array of 64-bit unsigned integers to hold the subidentifier values. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<OBJECT_IDENTIFIER>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncOctStr |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1UINT |
nocts, |
|
|
ASN1ConstOctetPtr |
data, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 OCTET STRING type.
- 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. |
| nocts | The number of octets (bytes) within the OCTET STRING to be encoded. |
| data | A pointer to an OCTET STRING containing the octet data to be encoded. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<OCTET_STRING>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncOpenType |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1UINT |
nocts, |
|
|
ASN1ConstOctetPtr |
data, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the old (pre-1994) ASN.1 ANY type or other elements defined in the later standards to be Open Types (for example, a variable type declaration in a CLASS construct as defined n X.681). A variable of this is considered to be a previously encoded ASN.1 message component.
- 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. |
| nocts | The number of octets (bytes) within the OCTET STRING to be encoded. |
| data | A pointer to an OCTET STRING containing an encoded ASN.1 message component. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<REAL>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncReal |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1REAL |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the REAL data type. This function provides support for the plus-infinity and the minus-infinity special real values. Use the rtGetPlusInfinity or rtGetMinusInfinity functions to get these special values.
- 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. |
| value | A value to be encoded. Special real values plus and minus infinity are encoded by using the rtGetPlusInfinity and rtGetMinusInfinity functions to set the real value to be encoded. |
| elemName | A pointer to the name of the element. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncRelativeOID |
( |
ASN1CTXT * |
pctxt, |
|
|
const ASN1OBJID * |
pvalue, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 RELATIVE-OID type.
- 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 an object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array to hold the subidentifier values. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<RELATIVE_OID>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncStartDocument |
( |
ASN1CTXT * |
pctxt |
) |
|
|
|
|
This function encodes the starting record of the XML document (such as the <?xml version = "1.0" encoding = "UTF-8"?>). This function should be called prior to encoding any other fields in the document. After all elements in the document are encoded, xerEncEndDocument should be called.
- 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:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncStartElement |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1ConstCharPtr |
elemName, |
|
|
ASN1ConstCharPtr |
attributes |
|
) |
|
|
|
|
This function encodes the string tag of the XML element, such as <element>. After the element's data is encoded, the xerEncEndElement function should be called.
- 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. |
| elemName | A pointer to the name of the element. |
| attributes | A pointer to the attributes of the element. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncUInt |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1UINT |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes an unsigned variable of the ASN.1 INTEGER type.
- 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.e. |
| value | An unsigned INTEGER value to be encoded. The ASNU1INT type is set to the C type 'unsigned int' in the asn1type.h file. This is assumed to represent a 32-bit integer value. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<INTEGER>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncUInt64 |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1UINT64 |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes an unsigned 64-bit variable of the ASN.1 INTEGER type.
- 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. |
| value | An unsigned 64-bit INTEGER value to be encoded. The ASN1UINT64 type is set to the C type 'unsigned __int64', 'unsigned long long' or 'unsigned long' in the asn1type.h file (depends on the used platform and the compiler). This is assumed to represent an unsigned 64-bit integer value. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If the name is null, the default name for this type (<INTEGER>) is added. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncUniCharData |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN1Const16BitCharPtr |
value, |
|
|
ASN1UINT |
nchars |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 character string types that are based on 16-bit character sets and are represented as null-terminated Unicode string. This includes IA5String, VisibleString, PrintableString, NumericString, and BMPString.
- 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. |
| value | A pointer to a null-terminated 16-bit string to be encoded. |
| nchars | The number of characters to be encoded. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncUniCharStr |
( |
ASN1CTXT * |
pctxt, |
|
|
ASN116BITCHAR * |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable one of the ASN.1 character string types that are based on 16-bit character sets and are represented as null-terminated Unicode strings. This includes IA5String, VisibleString, PrintableString, NumericString, Adn BMPString.
- 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. |
| value | A pointer to a null-terminated 16-bit character string to be encoded. |
| elemName | This argument specifies the name of the element that is wrapped around the encoded value. If an empty string is passed (""), no element tag is added to the encoded value. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerEncUnivStr |
( |
ASN1CTXT * |
pctxt, |
|
|
const ASN1UniversalString * |
value, |
|
|
ASN1ConstCharPtr |
elemName |
|
) |
|
|
|
|
This function encodes a variable of the ASN.1 Universal character string. This differs from the encode routines for the character strings previously described in that the Universal string type is based o te 32-bit characters. A 32-bit character string is modeled using an array of unsigned integers.
- 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. |
| value | A pointer to a structure representing a 16-bit character string to encoded. This structure contains a character count element and a pointer to an array of 32-bit character elements represented as 32-bit short integers. |
| elemName | A pointer to a name of an element. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int xerSetEncBufPtr |
( |
ASN1CTXT * |
pCtxt, |
|
|
ASN1OCTET * |
bufaddr, |
|
|
size_t |
bufsiz, |
|
|
ASN1BOOL |
canonical |
|
) |
|
|
|
|
This function is used to set the internal buffer within the runtime library encode module. It must be called prior to calling any other generated or runtime library encode functions.
- 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. |
| bufaddr | A pointer to a memory buffer containing the ASN.1 message. The pointer must point at the first byte in the message. |
| bufsiz | The size of the message that was read. This is used to set an internal message size to check for field length errors. If this size is not known, a zero value can be passed to cause these checks to be bypassed. |
| canonical | TRUE, if canonical XML encoding rules (CXER) should be used. Otherwise FALSE. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
|
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 |
|