1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
5 <refentry id="yaz-asncomp">
8 <refentrytitle>yaz-asncomp</refentrytitle>
9 <manvolnum>1</manvolnum>
13 <refname>yaz-asncomp</refname>
14 <refpurpose>YAZ ASN.1 compiler</refpurpose>
19 <command>yaz-asncomp</command>
20 <arg choice="opt"><option>-v</option></arg>
21 <arg choice="opt"><option>-c <replaceable>cfile</replaceable></option></arg>
22 <arg choice="opt"><option>-h <replaceable>hfile</replaceable></option></arg>
23 <arg choice="opt"><option>-p <replaceable>pfile</replaceable></option></arg>
24 <arg choice="opt"><option>-d <replaceable>config</replaceable></option></arg>
25 <arg choice="opt"><option>-I <replaceable>includeout</replaceable></option></arg>
26 <arg choice="opt"><option>-i <replaceable>includedir</replaceable></option></arg>
27 <arg choice="opt"><option>-m <replaceable>module</replaceable></option></arg>
28 <arg choice="opt">filename</arg>
32 <refsect1><title>DESCRIPTION</title>
34 <command>yaz-asncomp</command> is an ASN.1 compiler that
35 reads an ASN.1 specification in <replaceable>filename</replaceable>
36 and produces C/C++ definitions and BER encoders/decoders for it.
39 The produced C/C++ code and header files uses the ODR module of YAZ
40 which is a library that encodes/decodes/prints BER packages.
41 <command>yaz-asncomp</command> allows you to specify name of
42 resulting source via options. Alternatively, you can specify
43 a DEFINISIONS file, which provides customized output to
44 many output files - if the ASN.1 specification file consists
48 This utility is written in Tcl. Any version of Tcl should work.
52 <title>OPTIONS</title>
54 <varlistentry><term><literal>-v </literal>
58 Makes the ASN.1 compiler print more verbose about the
59 various stages of operations.
64 <varlistentry><term><literal>-c </literal>
65 <replaceable>cfile</replaceable></term>
67 Specifies the name of the C/C++ file with encoders/decoders.
71 <varlistentry><term><literal>-h </literal>
72 <replaceable>hfile</replaceable></term>
74 Specifies the name of header file with definitions.
78 <varlistentry><term><literal>-p </literal>
79 <replaceable>pfile</replaceable></term>
81 Specifies the name of the a private header file with
82 definitions. By default all definitions are put
83 in header file (option -h).
87 <varlistentry><term><literal>-d </literal>
88 <replaceable>dfile</replaceable></term>
90 Specifies the name of a definitions file.
94 <varlistentry><term><literal>-I </literal>
95 <replaceable>iout</replaceable></term>
97 Specifies first part of directory in which header files
102 <varlistentry><term><literal>-i </literal>
103 <replaceable>idir</replaceable></term>
105 Specifies second part of directory in which header files
110 <varlistentry><term><literal>-m </literal>
111 <replaceable>module</replaceable></term>
113 Specifies that ASN.1 compiler should only process the
114 module given. If this option is not specified,
115 all modules in the ASN.1 file are processed.
121 <refsect1><title>DEFINITIONS FILE</title>
123 The definitions file is really a Tcl script but follows
124 traditional rules for Shell like configuration files.
125 That is # denotes the beginning of a comment. Definitions
126 are line oriented. The definitions files usually consists of
127 a series of variable assignments of the form:
130 <literal>set</literal> <replaceable>name</replaceable> <replaceable>value</replaceable>
133 Available variables are:
136 <varlistentry><term><literal>default-prefix</literal></term>
138 Sets prefix for names in the produced output.
139 The value consists of three tokens: C function prefix,
140 C typedef prefix and preprocessor prefix respectively.
144 <varlistentry><term><literal>prefix(</literal><replaceable>module</replaceable><literal>)</literal></term>
146 This value sets prefix values for module
147 <replaceable>module</replaceable>.
148 The value has same form as <literal>default-prefix</literal>.
152 <varlistentry><term><literal>filename(</literal><replaceable>module</replaceable><literal>)</literal></term>
154 Specifies filename for C/header file for module
155 <replaceable>module</replaceable>.
159 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
161 Code fragment to be put in first part of public header for module
162 <replaceable>module</replaceable>.
166 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
168 Code fragment to be put in last part of public header for module
169 <replaceable>module</replaceable> (trailer).
173 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
175 Code fragment to be put in first part of C based encoder/decoder for
176 module <replaceable>module</replaceable>.
180 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
182 Code fragment to be put in last part of C based encoder/decoder for
183 module <replaceable>module</replaceable> (trailer).
187 <varlistentry><term><literal>map(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>)</literal></term>
189 Maps ASN.1 type in module <replaceable>module</replaceable>
190 of <replaceable>name</replaceable> to value.
194 <varlistentry><term><literal>membermap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
196 Maps member <replaceable>member</replaceable> in SEQUENCE/CHOICE of
197 <replaceable>name</replaceable> in module
198 <replaceable>module</replaceable> to value.
199 The value consists of one or two tokens.
200 First token is name of C preprocessor part. Second token
201 is resulting C member name. If second token is omitted
202 the value (one token) is both preprocessor part and
203 C <literal>struct</literal>,<literal>union</literal>.
207 <varlistentry><term><literal>unionmap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
209 Maps member <replaceable>member</replaceable> in CHOICE of
210 <replaceable>name</replaceable> in module
211 <replaceable>module</replaceable> to value.
212 Value consists of to or three tokens. The first token
213 is name of the integer in the <literal>union</literal> that
214 is used as selector for the <literal>union</literal> itself.
215 The second token is name of the <literal>union</literal>.
216 The third token overrides the name of the CHOICE member;
217 if omitted the member name is used.
223 <refsect1><title>FILES</title>
225 <filename>/usr/share/yaz/z39.50/z.tcl</filename>
228 <filename>/usr/share/yaz/z39.50/*.asn</filename>
231 <refsect1><title>SEE ALSO</title>
234 <refentrytitle>yaz</refentrytitle>
235 <manvolnum>7</manvolnum></citerefentry>
238 Section "The ODR Module" in the YAZ manual.
243 <!-- Keep this comment at the end of the file
248 sgml-minimize-attributes:nil
249 sgml-always-quote-attributes:t
252 sgml-parent-document:nil
253 sgml-local-catalogs: nil
254 sgml-namecase-general:t