1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
4 <refentry id="yaz-asncomp">
7 <refentrytitle>yaz-asncomp</refentrytitle>
8 <manvolnum>1</manvolnum>
12 <refname>yaz-asncomp</refname>
13 <refpurpose>YAZ ASN.1 compiler</refpurpose>
18 <command>yaz-asncomp</command>
19 <arg choice="opt"><option>-v</option></arg>
20 <arg choice="opt"><option>-c <replaceable>cfile</replaceable></option></arg>
21 <arg choice="opt"><option>-h <replaceable>hfile</replaceable></option></arg>
22 <arg choice="opt"><option>-p <replaceable>pfile</replaceable></option></arg>
23 <arg choice="opt"><option>-d <replaceable>config</replaceable></option></arg>
24 <arg choice="opt"><option>-I <replaceable>includeout</replaceable></option></arg>
25 <arg choice="opt"><option>-i <replaceable>includedir</replaceable></option></arg>
26 <arg choice="opt"><option>-m <replaceable>module</replaceable></option></arg>
27 <arg choice="opt">filename</arg>
31 <refsect1><title>DESCRIPTION</title>
33 <command>yaz-asncomp</command> is an ASN.1 compiler that
34 reads an ASN.1 specification in <replaceable>filename</replaceable>
35 and produces C/C++ definitions and BER encoders/decoders for it.
38 The produced C/C++ code and header files uses the ODR module of YAZ
39 which is a library that encodes/decodes/prints BER packages.
40 <command>yaz-asncomp</command> allows you to specify name of
41 resulting source via options. Alternatively, you can specify
42 a DEFINISIONS file, which provides customized output to
43 many output files - if the ASN.1 specification file consists
47 This utility is written in Tcl. Any version of Tcl should work.
51 <title>OPTIONS</title>
53 <varlistentry><term><literal>-v </literal>
57 Makes the ASN.1 compiler print more verbose about the
58 various stages of operations.
63 <varlistentry><term><literal>-c </literal>
64 <replaceable>cfile</replaceable></term>
66 Specifies the name of the C/C++ file with encoders/decoders.
70 <varlistentry><term><literal>-h </literal>
71 <replaceable>hfile</replaceable></term>
73 Specifies the name of header file with definitions.
77 <varlistentry><term><literal>-p </literal>
78 <replaceable>pfile</replaceable></term>
80 Specifies the name of the a private header file with
81 definitions. By default all definitions are put
82 in header file (option -h).
86 <varlistentry><term><literal>-d </literal>
87 <replaceable>dfile</replaceable></term>
89 Specifies the name of a definitions file.
93 <varlistentry><term><literal>-I </literal>
94 <replaceable>iout</replaceable></term>
96 Specifies first part of directory in which header files
101 <varlistentry><term><literal>-i </literal>
102 <replaceable>idir</replaceable></term>
104 Specifies second part of directory in which header files
109 <varlistentry><term><literal>-m </literal>
110 <replaceable>module</replaceable></term>
112 Specifies that ASN.1 compiler should only process the
113 module given. If this option is not specified,
114 all modules in the ASN.1 file are processed.
120 <refsect1><title>DEFINITIONS FILE</title>
122 The definitions file is really a Tcl script but follows
123 traditional rules for Shell like configuration files.
124 That is # denotes the beginning of a comment. Definitions
125 are line oriented. The definitions files usually consists of
126 a series of variable assignments of the form:
129 <literal>set</literal> <replaceable>name</replaceable> <replaceable>value</replaceable>
132 Available variables are:
135 <varlistentry><term><literal>default-prefix</literal></term>
137 Sets prefix for names in the produced output.
138 The value consists of three tokens: C function prefix,
139 C typedef prefix and preprocessor prefix respectively.
143 <varlistentry><term><literal>prefix(</literal><replaceable>module</replaceable><literal>)</literal></term>
145 This value sets prefix values for module
146 <replaceable>module</replaceable>.
147 The value has same form as <literal>default-prefix</literal>.
151 <varlistentry><term><literal>filename(</literal><replaceable>module</replaceable><literal>)</literal></term>
153 Specifies filename for C/header file for module
154 <replaceable>module</replaceable>.
158 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
160 Code fragment to be put in first part of public header for module
161 <replaceable>module</replaceable>.
165 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
167 Code fragment to be put in last part of public header for module
168 <replaceable>module</replaceable> (trailer).
172 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
174 Code fragment to be put in first part of C based encoder/decoder for
175 module <replaceable>module</replaceable>.
179 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
181 Code fragment to be put in last part of C based encoder/decoder for
182 module <replaceable>module</replaceable> (trailer).
186 <varlistentry><term><literal>map(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>)</literal></term>
188 Maps ASN.1 type in module <replaceable>module</replaceable>
189 of <replaceable>name</replaceable> to value.
193 <varlistentry><term><literal>membermap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
195 Maps member <replaceable>member</replaceable> in SEQUENCE/CHOICE of
196 <replaceable>name</replaceable> in module
197 <replaceable>module</replaceable> to value.
198 The value consists of one or two tokens.
199 First token is name of C preprocessor part. Second token
200 is resulting C member name. If second token is omitted
201 the value (one token) is both preprocessor part and
202 C <literal>struct</literal>,<literal>union</literal>.
206 <varlistentry><term><literal>unionmap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
208 Maps member <replaceable>member</replaceable> in CHOICE of
209 <replaceable>name</replaceable> in module
210 <replaceable>module</replaceable> to value.
211 Value consists of to or three tokens. The first token
212 is name of the integer in the <literal>union</literal> that
213 is used as selector for the <literal>union</literal> itself.
214 The second token is name of the <literal>union</literal>.
215 The third token overrides the name of the CHOICE member;
216 if omitted the member name is used.
222 <refsect1><title>FILES</title>
224 <filename>/usr/share/yaz/z39.50/z.tcl</filename>
227 <filename>/usr/share/yaz/z39.50/*.asn</filename>
230 <refsect1><title>SEE ALSO</title>
233 <refentrytitle>yaz</refentrytitle>
234 <manvolnum>7</manvolnum></citerefentry>
237 Section "The ODR Module" in the YAZ manual.
241 <!-- Keep this Emacs mode comment at the end of the file