TOC PREV NEXT INDEX


Generated C Function Format and Calling Parameters



The format of the name of each generated XER encode function is as follows:

    asn1XE_[<prefix>]<prodName>
 

where <prodName> is the name of the ASN.1 production for which the function is being generated and <prefix> is an optional prefix that can be set via a configuration file setting. The configuration setting used to set the prefix is the <typePrefix> element. This element specifies a prefix that will be applied to all generated typedef names and function names for the production.

The calling sequence for each encode function is as follows:

    status = asn1XE_<name> (OSCTXT* pctxt, <name>[*] value, 
 
                            const char* elemName, 
 
                            const char* attributes);
 

In this definition, <name> denotes the prefixed production name defined above.

The pctxt argument is used to hold a context pointer to keep track of encode parameters. This is a basic "handle" variable that is used to make the function reentrant so it can be used in an asynchronous or threaded application. The user is required to supply a pointer to a variable of this type declared somewhere in his or her or her program.

The value argument contains the value to be encoded or holds a pointer to the value to be encoded. This variable is of the type generated from the ASN.1 production. The object is passed by value if it is a primitive ASN.1 data type such as BOOLEAN, INTEGER, ENUMERATED, etc.. It is passed using a pointer reference if it is a structured ASN.1 type value (in this case, the name will be pvalue instead of value). Check the generated function prototype in the header file to determine how this argument is to be passed for a given function.

The elemName and attributes arguments are used to pass the XML element name and attributes respectively. The elemName argument is the name that will be included in the <name> </name> brackets used to delimit an XML item. There are three distinct ways this argument can be specified:


The function result variable stat returns the status of the encode operation. Status code zero indicates the function was successful. A negative value indicates encoding failed. Return status values are defined in the rtxErrCodes.h include file. The error text and a stack trace can be displayed using the rtxErrPrint function.



Objective Systems, Inc.

55 Dowlin Forge Road
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com
TOC PREV NEXT INDEX