Generated C Function Format and Calling Parameters

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

   MDERDec_[<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 decode function is as follows:

   status = MDERDec_<name> (OSCTXT* pctxt, <name> *pvalue);

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 decode 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 program. The variable must be initialized using the rtInitContext run-time function before use.

The pvalue argument is a pointer to a variable of the generated type that will receive the decoded data.

The function result variable status returns the status of the decode operation. The return status will be greater than or equal to zero if decoding is successful or negative if an error occurs. Return status values are defined in the "asn1type.h" include file.