1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
3 <refentry id="yaz-asncomp">
6 <refentrytitle>yaz-asncomp</refentrytitle>
7 <manvolnum>1</manvolnum>
11 <refname>yaz-asncomp</refname>
12 <refpurpose>YAZ ASN.1 compiler</refpurpose>
17 <command>yaz-asncomp</command>
18 <arg choice="opt"><option>-v</option></arg>
19 <arg choice="opt"><option>-c <replaceable>cfile</replaceable></option></arg>
20 <arg choice="opt"><option>-h <replaceable>hfile</replaceable></option></arg>
21 <arg choice="opt"><option>-p <replaceable>pfile</replaceable></option></arg>
22 <arg choice="opt"><option>-d <replaceable>config</replaceable></option></arg>
23 <arg choice="opt"><option>-I <replaceable>includeout</replaceable></option></arg>
24 <arg choice="opt"><option>-i <replaceable>includedir</replaceable></option></arg>
25 <arg choice="opt"><option>-m <replaceable>module</replaceable></option></arg>
26 <arg choice="opt">filename</arg>
30 <refsect1><title>DESCRIPTION</title>
32 <command>yaz-asncomp</command> is an ASN.1 compiler that
33 reads an ASN.1 specification in <replaceable>filename</replaceable>
34 and produces C/C++ definitions and BER encoders/decoders for it.
37 The produced C/C++ code and header files uses the ODR module of YAZ
38 which is a library that encodes/decodes/prints BER packages.
39 <command>yaz-asncomp</command> allows you to specify name of
40 resulting source via options. Alternatively, you can specify
41 a DEFINISIONS file, which provides customized output to
42 many output files - if the ASN.1 specification file consists
46 This utility is written in Tcl. Any version of Tcl should work.
50 <title>OPTIONS</title>
52 <varlistentry><term><literal>-v </literal>
56 Makes the ASN.1 compiler print more verbose about the
57 various stages of operations.
62 <varlistentry><term><literal>-c </literal>
63 <replaceable>cfile</replaceable></term>
65 Specifies the name of the C/C++ file with encoders/decoders.
69 <varlistentry><term><literal>-h </literal>
70 <replaceable>hfile</replaceable></term>
72 Specifies the name of header file with definitions.
76 <varlistentry><term><literal>-p </literal>
77 <replaceable>pfile</replaceable></term>
79 Specifies the name of the a private header file with
80 definitions. By default all definitions are put
81 in header file (option -h).
85 <varlistentry><term><literal>-d </literal>
86 <replaceable>dfile</replaceable></term>
88 Specifies the name of a definitions file.
92 <varlistentry><term><literal>-I </literal>
93 <replaceable>iout</replaceable></term>
95 Specifies first part of directory in which header files
100 <varlistentry><term><literal>-i </literal>
101 <replaceable>idir</replaceable></term>
103 Specifies second part of directory in which header files
108 <varlistentry><term><literal>-m </literal>
109 <replaceable>module</replaceable></term>
111 Specifies that ASN.1 compiler should only process the
112 module given. If this option is not specified,
113 all modules in the ASN.1 file are processed.
119 <refsect1><title>DEFINITIONS FILE</title>
121 The definitions file is really a Tcl script but follows
122 traditional rules for Shell like configuration files.
123 That is # denotes the beginning of a comment. Definitions
124 are line oriented. The definitions files usually consists of
125 a series of variable assignments of the form:
128 <literal>set</literal> <replaceable>name</replaceable> <replaceable>value</replaceable>
131 Available variables are:
134 <varlistentry><term><literal>default-prefix</literal></term>
136 Sets prefix for names in the produced output.
137 The value consists of three tokens: C function prefix,
138 C typedef prefix and preprocessor prefix respectively.
142 <varlistentry><term><literal>prefix(</literal><replaceable>module</replaceable><literal>)</literal></term>
144 This value sets prefix values for module
145 <replaceable>module</replaceable>.
146 The value has same form as <literal>default-prefix</literal>.
150 <varlistentry><term><literal>filename(</literal><replaceable>module</replaceable><literal>)</literal></term>
152 Specifies filename for C/header file for module
153 <replaceable>module</replaceable>.
157 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
159 Code fragment to be put in first part of public header for module
160 <replaceable>module</replaceable>.
164 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
166 Code fragment to be put in last part of public header for module
167 <replaceable>module</replaceable> (trailer).
171 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
173 Code fragment to be put in first part of C based encoder/decoder for
174 module <replaceable>module</replaceable>.
178 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
180 Code fragment to be put in last part of C based encoder/decoder for
181 module <replaceable>module</replaceable> (trailer).
185 <varlistentry><term><literal>map(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>)</literal></term>
187 Maps ASN.1 type in module <replaceable>module</replaceable>
188 of <replaceable>name</replaceable> to value.
192 <varlistentry><term><literal>membermap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
194 Maps member <replaceable>member</replaceable> in SEQUENCE/CHOICE of
195 <replaceable>name</replaceable> in module
196 <replaceable>module</replaceable> to value.
197 The value consists of one or two tokens.
198 First token is name of C preprocessor part. Second token
199 is resulting C member name. If second token is omitted
200 the value (one token) is both preprocessor part and
201 C <literal>struct</literal>,<literal>union</literal>.
205 <varlistentry><term><literal>unionmap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
207 Maps member <replaceable>member</replaceable> in CHOICE of
208 <replaceable>name</replaceable> in module
209 <replaceable>module</replaceable> to value.
210 Value consists of to or three tokens. The first token
211 is name of the integer in the <literal>union</literal> that
212 is used as selector for the <literal>union</literal> itself.
213 The second token is name of the <literal>union</literal>.
214 The third token overrides the name of the CHOICE member;
215 if omitted the member name is used.
221 <refsect1><title>FILES</title>
223 <filename>/usr/share/yaz/z39.50/z.tcl</filename>
226 <filename>/usr/share/yaz/z39.50/*.asn</filename>
229 <refsect1><title>SEE ALSO</title>
232 <refentrytitle>yaz</refentrytitle>
233 <manvolnum>7</manvolnum></citerefentry>
236 Section "The ODR Module" in the YAZ manual.
241 <!-- Keep this comment at the end of the file
246 sgml-minimize-attributes:nil
247 sgml-always-quote-attributes:t
250 sgml-parent-document:nil
251 sgml-local-catalogs: nil
252 sgml-namecase-general:t