
Generated Compare Functions
The -genCompare option causes comparison functions to be generated. These functions can be used to compare the contents of two generated type variables.
If an output file is not specified with the -genCompare qualifier, the functions are written to separate .c files for each module in the source file. The format of the name of each file is <module>Compare.c. If an output filename is specified after the -genCompare qualifier, all functions are written to that file.
asn1Compare_[<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.
OSBOOL asn1Compare_<name> (const char* name, <name>* pvalue, <name>* pCmpValue, char* errBuff, int errBufSize);The name argument is used to hold the top-level name of the variable being compared. It is typically set to the same name as the pvalue argument in quotes (for example, to compare employee records, a call to `asn1Compare_Employee ("employee", &employee, etc.)' might be used).
The pvalue argument is used to pass a pointer to a variable of the item to the first item to be compared. The pCmpValue argument is used to pass the second value. The two items are then compared field-by-field for equality.
The errBuff and errBuffSize arguments are used to describe a text buffer into which information on what fields the comparison failed on is written. These arguments specify a fixed-size buffer - if the generated text is larger than the given buffer size, the text is terminated.
Objective Systems, Inc.55 Dowlin Forge RoadExton, 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 |