Add wrbuf_sha1_puts
[yaz-moved-to-github.git] / doc / yaz-asncomp-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10 ]>
11 <refentry id="yaz-asncomp">
12  <refentryinfo>
13   <productname>YAZ</productname>
14   <productnumber>&version;</productnumber>
15   <info><orgname>Index Data</orgname></info>
16  </refentryinfo>
17
18  <refmeta>
19   <refentrytitle>yaz-asncomp</refentrytitle>
20   <manvolnum>1</manvolnum>
21   <refmiscinfo class="manual">Commands</refmiscinfo>
22  </refmeta>
23
24  <refnamediv>
25   <refname>yaz-asncomp</refname>
26   <refpurpose>YAZ ASN.1 compiler</refpurpose>
27  </refnamediv>
28
29  <refsynopsisdiv>
30   <cmdsynopsis>
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>
41   </cmdsynopsis>
42
43  </refsynopsisdiv>
44   <refsect1><title>DESCRIPTION</title>
45   <para>
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.
49   </para>
50   <para>
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 DEFINISIONS file, which provides customized output to
56    many output files - if the ASN.1 specification file consists
57    of many modules.
58   </para>
59   <para>
60    This utility is written in Tcl. Any version of Tcl should work.
61   </para>
62   </refsect1>
63     <refsect1>
64   <title>OPTIONS</title>
65   <variablelist>
66    <varlistentry><term><literal>-v </literal>
67  </term>
68     <listitem>
69      <para>
70       Makes the ASN.1 compiler print more verbose about the
71       various stages of operations.
72      </para>
73     </listitem>
74    </varlistentry>
75
76    <varlistentry><term><literal>-c </literal>
77      <replaceable>cfile</replaceable></term>
78     <listitem><para>
79       Specifies the name of the C/C++ file with encoders/decoders.
80      </para></listitem>
81    </varlistentry>
82
83    <varlistentry><term><literal>-h </literal>
84      <replaceable>hfile</replaceable></term>
85     <listitem><para>
86       Specifies the name of header file with definitions.
87      </para></listitem>
88    </varlistentry>
89
90    <varlistentry><term><literal>-p </literal>
91      <replaceable>pfile</replaceable></term>
92     <listitem><para>
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).
96      </para></listitem>
97    </varlistentry>
98
99    <varlistentry><term><literal>-d </literal>
100      <replaceable>dfile</replaceable></term>
101     <listitem><para>
102       Specifies the name of a definitions file.
103      </para></listitem>
104    </varlistentry>
105
106    <varlistentry><term><literal>-I </literal>
107      <replaceable>iout</replaceable></term>
108     <listitem><para>
109       Specifies first part of directory in which header files
110       are written.
111      </para></listitem>
112    </varlistentry>
113
114    <varlistentry><term><literal>-i </literal>
115      <replaceable>idir</replaceable></term>
116     <listitem><para>
117       Specifies second part of directory in which header files
118       are written.
119      </para></listitem>
120    </varlistentry>
121
122    <varlistentry><term><literal>-m </literal>
123      <replaceable>module</replaceable></term>
124     <listitem><para>
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.
128      </para></listitem>
129    </varlistentry>
130
131   </variablelist>
132  </refsect1>
133  <refsect1><title>DEFINITIONS FILE</title>
134   <para>
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 consists of
139    a series of variable assignments of the form:
140   </para>
141   <para>
142    <literal>set</literal> <replaceable>name</replaceable> <replaceable>value</replaceable>
143   </para>
144   <para>
145    Available variables are:
146    <variablelist>
147
148     <varlistentry><term><literal>default-prefix</literal></term>
149      <listitem><para>
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.
153       </para></listitem>
154     </varlistentry>
155
156     <varlistentry><term><literal>prefix(</literal><replaceable>module</replaceable><literal>)</literal></term>
157      <listitem><para>
158        This value sets prefix values for module
159        <replaceable>module</replaceable>.
160        The value has same form as <literal>default-prefix</literal>.
161       </para></listitem>
162     </varlistentry>
163
164     <varlistentry><term><literal>filename(</literal><replaceable>module</replaceable><literal>)</literal></term>
165      <listitem><para>
166        Specifies filename for C/header file for module
167        <replaceable>module</replaceable>.
168       </para></listitem>
169     </varlistentry>
170
171     <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
172      <listitem><para>
173        Code fragment to be put in first part of public header for module
174     <replaceable>module</replaceable>.
175       </para></listitem>
176     </varlistentry>
177
178     <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,h)</literal></term>
179      <listitem><para>
180        Code fragment to be put in last part of public header for module
181     <replaceable>module</replaceable> (trailer).
182       </para></listitem>
183     </varlistentry>
184
185     <varlistentry><term><literal>init(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
186      <listitem><para>
187        Code fragment to be put in first part of C based encoder/decoder for
188        module <replaceable>module</replaceable>.
189       </para></listitem>
190     </varlistentry>
191
192     <varlistentry><term><literal>body(</literal><replaceable>module</replaceable><literal>,c)</literal></term>
193      <listitem><para>
194        Code fragment to be put in last part of C based encoder/decoder for
195        module <replaceable>module</replaceable> (trailer).
196       </para></listitem>
197     </varlistentry>
198
199     <varlistentry><term><literal>map(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>)</literal></term>
200      <listitem><para>
201        Maps ASN.1 type in module <replaceable>module</replaceable>
202        of <replaceable>name</replaceable> to value.
203       </para></listitem>
204     </varlistentry>
205
206     <varlistentry><term><literal>membermap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
207      <listitem><para>
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>.
216       </para></listitem>
217     </varlistentry>
218
219     <varlistentry><term><literal>unionmap(</literal><replaceable>module</replaceable><literal>,</literal><replaceable>name</replaceable><literal>,</literal><replaceable>member</replaceable><literal>)</literal></term>
220      <listitem><para>
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 to 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.
230       </para></listitem>
231     </varlistentry>
232    </variablelist>
233   </para>
234  </refsect1>
235  <refsect1><title>FILES</title>
236   <para>
237    <filename>/usr/share/yaz/z39.50/z.tcl</filename>
238   </para>
239   <para>
240    <filename>/usr/share/yaz/z39.50/*.asn</filename>
241   </para>
242  </refsect1>
243  <refsect1><title>SEE ALSO</title>
244   <para>
245    <citerefentry>
246     <refentrytitle>yaz</refentrytitle>
247     <manvolnum>7</manvolnum></citerefentry>
248   </para>
249   <para>
250    Section "The ODR Module" in the YAZ manual.
251   </para>
252  </refsect1>
253 </refentry>
254
255 <!-- Keep this comment at the end of the file
256 Local variables:
257 mode: sgml
258 sgml-omittag:t
259 sgml-shorttag:t
260 sgml-minimize-attributes:nil
261 sgml-always-quote-attributes:t
262 sgml-indent-step:1
263 sgml-indent-data:t
264 sgml-parent-document:nil
265 sgml-local-catalogs: nil
266 sgml-namecase-general:t
267 End:
268 -->