
Use of the -maxcfiles Option
The -maxcfiles option allows generation of more compact code by putting each encode, decode, copy, compare, etc function into a separate file. This allows the linker to link in only the required functions as opposed to all functions in a compiled object module. This option might be useful for applications that have minimal space requirements (for example, embedded systems).
To achieve the best results it is necessary to put all compiled object files into an object library (.a or .lib file) and include this library in the link command. The -genMake option when used in conjunction with -maxcfiles will generate a makefile that will compile each of the generated files and add them to a library with a name based on the name of the ASN.1 module being compiled (<moduleName>.lib for Windows or lib<moduleName>.a for *NIX).
asn1<suffix>_<prodname>.cEmployee DEFINITIONS ::= BEGIN ... Name ::= [APPLICATION 1] IMPLICIT SEQUENCE { givenName IA5String, initial IA5String, familyName IA5String } ... ENDBy default, the following .c files would be generated (note: this assumes no additional code generation options were selected):
Employee.c EmployeeEnc.c EmployeeDec.casn1c employee.asn -c -ber -trace -maxcfilesasn1D_Name.c asn1E_Name.c
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 |