User Commands YAZ-ASNCOMP(1) NAME yaz-asncomp - YAZ ASN.1 compiler SYNOPSIS yaz-asncomp [-v] [-c _c_f_i_l_e] [-h _h_f_i_l_e] [-p _p_f_i_l_e] [-d _c_o_n_f_i_g] [-I _i_n_c_l_u_d_e_o_u_t] [-i _i_n_c_l_u_d_e_d_i_r] [-m _m_o_d_u_l_e] [filename] DESCRIPTION yaz-asncomp is an ASN.1 compiler that reads an ASN.1 specification in _f_i_l_e_n_a_m_e and produces C/C++ definitions and BER encoders/decoders for it. The produced C/C++ code and header files uses the ODR module of YAZ which is a library that encodes/decodes/prints BER packages. yaz-asncomp allows you to specify name of resulting source via options. Alternatively, you can specify a DEFINISIONS file, which provides customized output to many output files - if the ASN.1 specification file consists of many modules. This utility is written in Tcl. Any version of Tcl should work. OPTIONS -v Makes the ASN.1 compiler print more verbose about the various stages of operations. -c _c_f_i_l_e Specifies the name of the C/C++ file with encoders/decoders. -h _h_f_i_l_e Specifies the name of header file with definitions. -p _p_f_i_l_e Specifies the name of the a private header file with definitions. By default all definitions are put in header file (option -h). -d _d_f_i_l_e Specifies the name of a definitions file. -I _i_o_u_t Specifies first part of directory in which header files are written. -i _i_d_i_r Specifies second part of directory in which header files are written. YAZ 3.0.46 Last change: 06/08/2009 1 User Commands YAZ-ASNCOMP(1) -m _m_o_d_u_l_e Specifies that ASN.1 compiler should only process the module given. If this option is not specified, all modules in the ASN.1 file are processed. DEFINITIONS FILE The definitions file is really a Tcl script but follows traditional rules for Shell like configuration files. That is # denotes the beginning of a comment. Definitions are line oriented. The definitions files usually consists of a series of variable assignments of the form: set _n_a_m_e _v_a_l_u_e Available variables are: default-prefix Sets prefix for names in the produced output. The value consists of three tokens: C function prefix, C typedef prefix and preprocessor prefix respectively. prefix(_m_o_d_u_l_e) This value sets prefix values for module _m_o_d_u_l_e. The value has same form as default-prefix. filename(_m_o_d_u_l_e) Specifies filename for C/header file for module _m_o_d_u_l_e. init(_m_o_d_u_l_e,h) Code fragment to be put in first part of public header for module _m_o_d_u_l_e. body(_m_o_d_u_l_e,h) Code fragment to be put in last part of public header for module _m_o_d_u_l_e (trailer). init(_m_o_d_u_l_e,c) Code fragment to be put in first part of C based encoder/decoder for module _m_o_d_u_l_e. body(_m_o_d_u_l_e,c) Code fragment to be put in last part of C based encoder/decoder for module _m_o_d_u_l_e (trailer). map(_m_o_d_u_l_e,_n_a_m_e) Maps ASN.1 type in module _m_o_d_u_l_e of _n_a_m_e to value. membermap(_m_o_d_u_l_e,_n_a_m_e,_m_e_m_b_e_r) Maps member _m_e_m_b_e_r in SEQUENCE/CHOICE of _n_a_m_e in module _m_o_d_u_l_e to value. The value consists of one or two tokens. First token is name of C preprocessor part. Second token is resulting C member name. If second token YAZ 3.0.46 Last change: 06/08/2009 2 User Commands YAZ-ASNCOMP(1) is omitted the value (one token) is both preprocessor part and C struct,union. unionmap(_m_o_d_u_l_e,_n_a_m_e,_m_e_m_b_e_r) Maps member _m_e_m_b_e_r in CHOICE of _n_a_m_e in module _m_o_d_u_l_e to value. Value consists of to or three tokens. The first token is name of the integer in the union that is used as selector for the union itself. The second token is name of the union. The third token overrides the name of the CHOICE member; if omitted the member name is used. FILES /_u_s_r/_s_h_a_r_e/_y_a_z/_z_3_9._5_0/_z._t_c_l /_u_s_r/_s_h_a_r_e/_y_a_z/_z_3_9._5_0/*._a_s_n SEE ALSO yaz(7) Section "The ODR Module" in the YAZ manual. ATTRIBUTES See attributes(5) for descriptions of the following attributes: _______________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE| |_________________________________________|____________________________________|_ | Availability | SUNWlibyaz | |_________________________________________|____________________________________|_ | Interface Stability| Uncommitted | |_____________________|__________________| NOTES Source for YAZ is available on http://opensolaris.org. YAZ 3.0.46 Last change: 06/08/2009 3