1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
4 <!ENTITY % local SYSTEM "local.ent">
6 <!ENTITY % entities SYSTEM "entities.ent">
8 <!ENTITY % idcommon SYSTEM "common/common.ent">
11 <refentry id="yaz-asncomp">
13 <productname>YAZ</productname>
14 <productnumber>&version;</productnumber>
15 <orgname>Index Data</orgname>
19 <refentrytitle>yaz-asncomp</refentrytitle>
20 <manvolnum>1</manvolnum>
21 <refmiscinfo class="manual">Commands</refmiscinfo>
25 <refname>yaz-asncomp</refname>
26 <refpurpose>YAZ ASN.1 compiler</refpurpose>
31 <command>yaz-asncomp</command>
32 <arg choice="opt"><option>-v</option></arg>
33 <arg choice="opt"><option>-c <replaceable>cfile</replaceable></option></arg>
34 <arg choice="opt"><option>-h <replaceable>hfile</replaceable></option></arg>
35 <arg choice="opt"><option>-p <replaceable>pfile</replaceable></option></arg>
36 <arg choice="opt"><option>-d <replaceable>config</replaceable></option></arg>
37 <arg choice="opt"><option>-I <replaceable>includeout</replaceable></option></arg>
38 <arg choice="opt"><option>-i <replaceable>includedir</replaceable></option></arg>
39 <arg choice="opt"><option>-m <replaceable>module</replaceable></option></arg>
40 <arg choice="opt">filename</arg>
44 <refsect1><title>DESCRIPTION</title>
46 <command>yaz-asncomp</command> is an ASN.1 compiler that
47 reads an ASN.1 specification in <replaceable>filename</replaceable>
48 and produces C/C++ definitions and BER encoders/decoders for it.
51 The produced C/C++ code and header files uses the ODR module of YAZ
52 which is a library that encodes/decodes/prints BER packages.
53 <command>yaz-asncomp</command> allows you to specify name of
54 resulting source via options. Alternatively, you can specify
55 a DEFINITIONS file, which provides customized output to
56 many output files - if the ASN.1 specification file consists
60 This utility is written in Tcl. Any version of Tcl should work.
64 <title>OPTIONS</title>
66 <varlistentry><term><literal>-v </literal>
70 Makes the ASN.1 compiler print more verbose about the
71 various stages of operations.
76 <varlistentry><term><literal>-c </literal>
77 <replaceable>cfile</replaceable></term>
79 Specifies the name of the C/C++ file with encoders/decoders.
83 <varlistentry><term><literal>-h </literal>
84 <replaceable>hfile</replaceable></term>
86 Specifies the name of header file with definitions.
90 <varlistentry><term><literal>-p </literal>
91 <replaceable>pfile</replaceable></term>
93 Specifies the name of the a private header file with
94 definitions. By default all definitions are put
95 in header file (option -h).
99 <varlistentry><term><literal>-d </literal>
100 <replaceable>dfile</replaceable></term>
102 Specifies the name of a definitions file.
106 <varlistentry><term><literal>-I </literal>
107 <replaceable>iout</replaceable></term>
109 Specifies first part of directory in which header files
114 <varlistentry><term><literal>-i </literal>
115 <replaceable>idir</replaceable></term>
117 Specifies second part of directory in which header files
122 <varlistentry><term><literal>-m </literal>
123 <replaceable>module</replaceable></term>
125 Specifies that ASN.1 compiler should only process the
126 module given. If this option is not specified,
127 all modules in the ASN.1 file are processed.
133 <refsect1><title>DEFINITIONS FILE</title>
135 The definitions file is really a Tcl script but follows
136 traditional rules for Shell like configuration files.
137 That is # denotes the beginning of a comment. Definitions
138 are line oriented. The definitions files usually consist of
139 a series of variable assignments of the form:
142 <literal>set</literal> <replaceable>name</replaceable> <replaceable>value</replaceable>
145 Available variables are:
148 <varlistentry><term><literal>default-prefix</literal></term>
150 Sets prefix for names in the produced output.
151 The value consists of three tokens: C function prefix,
152 C typedef prefix and preprocessor prefix respectively.
156 <varlistentry><term><literal>prefix(</literal><replaceable>module</replaceable><literal>)</literal></term>
158 This value sets prefix values for module
159 <replaceable>module</replaceable>.
160 The value has same form as <literal>default-prefix</literal>.
164 <varlistentry><term><literal>filename(</literal><replaceable>module</replaceable><literal>)</literal></term>
166 Specifies filename for C/header file for module
167 <replaceable>module</replaceable>.
171 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
173 Code fragment to be put in first part of public header for module
174 <replaceable>module</replaceable>.
178 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
180 Code fragment to be put in last part of public header for module
181 <replaceable>module</replaceable> (trailer).
185 <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
187 Code fragment to be put in first part of C based encoder/decoder for
188 module <replaceable>module</replaceable>.
192 <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
194 Code fragment to be put in last part of C based encoder/decoder for
195 module <replaceable>module</replaceable> (trailer).
199 <varlistentry><term><literal>map(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>)</literal></term>
201 Maps ASN.1 type in module <replaceable>module</replaceable>
202 of <replaceable>name</replaceable> to value.
206 <varlistentry><term><literal>membermap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
208 Maps member <replaceable>member</replaceable> in SEQUENCE/CHOICE of
209 <replaceable>name</replaceable> in module
210 <replaceable>module</replaceable> to value.
211 The value consists of one or two tokens.
212 First token is name of C preprocessor part. Second token
213 is resulting C member name. If second token is omitted
214 the value (one token) is both preprocessor part and
215 C <literal>struct</literal>,<literal>union</literal>.
219 <varlistentry><term><literal>unionmap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
221 Maps member <replaceable>member</replaceable> in CHOICE of
222 <replaceable>name</replaceable> in module
223 <replaceable>module</replaceable> to value.
224 Value consists of two or three tokens. The first token
225 is name of the integer in the <literal>union</literal> that
226 is used as selector for the <literal>union</literal> itself.
227 The second token is name of the <literal>union</literal>.
228 The third token overrides the name of the CHOICE member;
229 if omitted the member name is used.
235 <refsect1><title>FILES</title>
237 <filename>/usr/share/yaz/z39.50/z.tcl</filename>
240 <filename>/usr/share/yaz/z39.50/*.asn</filename>
243 <refsect1><title>SEE ALSO</title>
246 <refentrytitle>yaz</refentrytitle>
247 <manvolnum>7</manvolnum></citerefentry>
250 Section "The ODR Module" in the YAZ manual.
255 <!-- Keep this comment at the end of the file