summaryrefslogtreecommitdiff
path: root/doc/invoke-xml2ag.texi
blob: 715f742873dc9248290603dcf0bb7ff7bbcec529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
@node xml2ag Invocation
@section Invoking xml2ag
@pindex xml2ag
@cindex XML to AutoGen Definiton Converter
@ignore
#  -*- buffer-read-only: t -*- vi: set ro:
# 
# DO NOT EDIT THIS FILE   (invoke-xml2ag.texi)
# 
# It has been AutoGen-ed  August 11, 2012 at 09:42:28 AM by AutoGen 5.16.2
# From the definitions    ./xmlopts.def
# and the template file   agtexi-cmd
@end ignore

This program will convert any arbitrary XML file into equivalent
AutoGen definitions, and invoke AutoGen.
The template used will be derived from either:
@itemize @bullet
@item
The @strong{--override-tpl} command line option
@item
A top level XML attribute named, "@code{template}"
@end itemize
@noindent
One or the other @strong{must} be provided, or the program will
exit with a failure message.

The @emph{base-name} for the output will similarly be either:
@itemize @bullet
@item
The @strong{--base-name} command line option.
@item
The base name of the @file{.xml} file.
@end itemize

The definitions derived from XML generally have an extra layer
of definition.  Specifically, this XML input:
@example
<mumble attr="foo">
  mumble-1
  <grumble>
  grumble, grumble, grumble.
</grumble>mumble, mumble
</mumble>
@end example
Will get converted into this:
@example
mumble = @{
  grumble = @{
    text = 'grumble, grumble, grumble';
  @};
  text = 'mumble-1';
  text = 'mumble, mumble';
@};
@end example
Please notice that some information is lost.  AutoGen cannot tell that
"grumble" used to lie between the mumble texts.  Also please note that
you cannot assign:
@example
grumble = 'grumble, grumble, grumble.';
@end example
because if another "grumble" has an attribute or multiple texts,
it becomes impossible to have the definitions be the same type
(compound or text values).

This section was generated by @strong{AutoGen},
using the @code{agtexi-cmd} template and the option descriptions for the @code{xml2ag} program.
This software is released under the GNU General Public License, version 3 or later.

@menu
* xml2ag usage::                  xml2ag help/usage (@option{--help})
* xml2ag the-xml2ag-option::      the-xml2ag-option options
* xml2ag autogen-options::        autogen-options options
* xml2ag exit status::            exit status
@end menu

@node xml2ag usage
@subsection xml2ag help/usage (@option{--help})
@cindex xml2ag help

This is the automatically generated usage text for xml2ag.

The text printed is the same whether selected with the @code{help} option
(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
the usage text by passing it through a pager program.
@code{more-help} is disabled on platforms without a working
@code{fork(2)} function.  The @code{PAGER} environment variable is
used to select the program, defaulting to @file{more}.  Both will exit
with a status code of 0.

@exampleindent 0
@example
xml2ag (GNU AutoGen) - XML to AutoGen Definiton Converter - Ver. 5.16.2
USAGE:  xml2ag [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ <def-file> ]

All other options are derived from autogen:

  Flg Arg Option-Name    Description
   -O Str output         Output file in lieu of AutoGen processing

All other options:

  Flg Arg Option-Name    Description
   -L Str templ-dirs     Template search directory list
                                - may appear multiple times
   -T Str override-tpl   Override template file
   -l Str lib-template   Library template file
                                - may appear multiple times
      Str definitions    Definitions input file
   -S Str load-scheme    Scheme code file to load
   -F Str load-functions Load scheme function library
      Str shell          name or path name of shell to use
   -m no  no-fmemopen    Do not use in-mem streams
      Str equate         characters considered equivalent
   -b Str base-name      Base name for output file(s)
      no  source-time    set mod times to latest source
      no  writable       Allow output files to be writable
                                - disabled as --not-writable
      Num loop-limit     Limit on increment loops
                                - is scalable with a suffix: k/K/m/M/g/G/t/T
                                - It must lie in one of the ranges:
                                  -1 exactly, or
                                  1 to 16777216
   -t Num timeout        Time limit for server shell
                                - It must be in the range:
                                  0 to 3600
      KWd trace          tracing level of detail
      Str trace-out      tracing output file or filter
      no  show-defs      Show the definition tree
      no  used-defines   Show the definitions used
   -C no  core           Leave a core dump on a failure exit
   -s Str skip-suffix    Omit the file with this suffix
                                - prohibits these options:
                                select-suffix
                                - may appear multiple times
   -o Str select-suffix  specify this output suffix
                                - may appear multiple times
   -D Str define         name to add to definition list
                                - may appear multiple times
   -U Str undefine       definition list removal pattern
                                - an alternate for define
   -M opt make-dep       emit make dependency file
                                - may appear multiple times

version, usage and configuration options:

  Flg Arg Option-Name    Description
   -v opt version        Output version information and exit
   -? no  help           Display extended usage information and exit
   -! no  more-help      Extended usage information passed thru pager

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.

This program will convert any arbitrary XML file into equivalent AutoGen
definitions, and invoke AutoGen.

The valid "trace" option keywords are:
  nothing       debug-message server-shell  templates     block-macros
  expressions   everything
  or an integer from 0 through 6

The template will be derived from either: * the ``--override-tpl'' command
line option * a top level XML attribute named, "template"

The ``base-name'' for the output will similarly be either: * the
``--base-name'' command line option * the base name of the .xml file
Packaged by Bruce (2012-08-11)
Report xml2ag bugs to bkorb@@gnu.org
@end example
@exampleindent 4

@node xml2ag the-xml2ag-option
@subsection the-xml2ag-option options
All other options are derived from autogen.
@subsubheading output option (-O).
@anchor{xml2ag output}
@cindex xml2ag-output

This is the ``output file in lieu of autogen processing'' option.
This option takes an argument string @file{file}.
By default, the output is handed to an AutoGen for processing.
However, you may save the definitions to a file instead.
@node xml2ag autogen-options
@subsection autogen-options options
All other options.
These options are @i{mostly} just passed throug to @code{autogen}.
The one exception is @code{--override-tpl} which replaces the
default template in the output definitions.  It does not get passed
through on the command line.
@subsubheading templ-dirs option (-L).
@anchor{xml2ag templ-dirs}
@cindex xml2ag-templ-dirs

This is the ``template search directory list'' option.
This option takes an argument string @file{dir}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading override-tpl option (-T).
@anchor{xml2ag override-tpl}
@cindex xml2ag-override-tpl

This is the ``override template file'' option.
This option takes an argument string @file{tpl-file}.
Pass-through AutoGen argument
@subsubheading lib-template option (-l).
@anchor{xml2ag lib-template}
@cindex xml2ag-lib-template

This is the ``library template file'' option.
This option takes an argument string @file{tpl-file}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading definitions option.
@anchor{xml2ag definitions}
@cindex xml2ag-definitions

This is the ``definitions input file'' option.
This option takes an argument string @file{file}.
Pass-through AutoGen argument
@subsubheading load-scheme option (-S).
@anchor{xml2ag load-scheme}
@cindex xml2ag-load-scheme

This is the ``scheme code file to load'' option.
This option takes an argument string @file{file}.
Pass-through AutoGen argument
@subsubheading load-functions option (-F).
@anchor{xml2ag load-functions}
@cindex xml2ag-load-functions

This is the ``load scheme function library'' option.
This option takes an argument string @file{file}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{HAVE_DLOPEN} during the compilation.
@end itemize

Pass-through AutoGen argument
@subsubheading shell option.
@anchor{xml2ag shell}
@cindex xml2ag-shell

This is the ``name or path name of shell to use'' option.
This option takes an argument string @file{shell}.
Pass-through AutoGen argument
@subsubheading no-fmemopen option (-m).
@anchor{xml2ag no-fmemopen}
@cindex xml2ag-no-fmemopen

This is the ``do not use in-mem streams'' option.
Pass-through AutoGen argument
@subsubheading equate option.
@anchor{xml2ag equate}
@cindex xml2ag-equate

This is the ``characters considered equivalent'' option.
This option takes an argument string @file{char-list}.
Pass-through AutoGen argument
@subsubheading base-name option (-b).
@anchor{xml2ag base-name}
@cindex xml2ag-base-name

This is the ``base name for output file(s)'' option.
This option takes an argument string @file{name}.
Pass-through AutoGen argument
@subsubheading source-time option.
@anchor{xml2ag source-time}
@cindex xml2ag-source-time

This is the ``set mod times to latest source'' option.
Pass-through AutoGen argument
@subsubheading writable option.
@anchor{xml2ag writable}
@cindex xml2ag-writable

This is the ``allow output files to be writable'' option.
Pass-through AutoGen argument
@subsubheading loop-limit option.
@anchor{xml2ag loop-limit}
@cindex xml2ag-loop-limit

This is the ``limit on increment loops'' option.
This option takes an argument number @file{lim}.
Pass-through AutoGen argument
@subsubheading timeout option (-t).
@anchor{xml2ag timeout}
@cindex xml2ag-timeout

This is the ``time limit for server shell'' option.
This option takes an argument number @file{time-lim}.
Pass-through AutoGen argument
@subsubheading trace option.
@anchor{xml2ag trace}
@cindex xml2ag-trace

This is the ``tracing level of detail'' option.
This option takes an argument keyword @file{level}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
This option takes a keyword as its argument.
The argument sets an enumeration value that can be tested by comparing the option value macro (OPT_VALUE_TRACE).
The available keywords are:
@example
    nothing       debug-message server-shell
    templates     block-macros  expressions
    everything
@end example

or their numeric equivalent.@end itemize

Pass-through AutoGen argument
@subsubheading trace-out option.
@anchor{xml2ag trace-out}
@cindex xml2ag-trace-out

This is the ``tracing output file or filter'' option.
This option takes an argument string @file{file}.
Pass-through AutoGen argument
@subsubheading show-defs option.
@anchor{xml2ag show-defs}
@cindex xml2ag-show-defs

This is the ``show the definition tree'' option.
Pass-through AutoGen argument
@subsubheading used-defines option.
@anchor{xml2ag used-defines}
@cindex xml2ag-used-defines

This is the ``show the definitions used'' option.
Pass-through AutoGen argument
@subsubheading core option (-C).
@anchor{xml2ag core}
@cindex xml2ag-core

This is the ``leave a core dump on a failure exit'' option.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
must be compiled in by defining @code{HAVE_SYS_RESOURCE_H} during the compilation.
@end itemize

Many systems default to a zero sized core limit.  If the system
has the sys/resource.h header and if this option is supplied,
then in the failure exit path, autogen will attempt to set the
soft core limit to whatever the hard core limit is.  If that
does not work, then an administrator must raise the hard core
size limit.
@subsubheading skip-suffix option (-s).
@anchor{xml2ag skip-suffix}
@cindex xml2ag-skip-suffix

This is the ``omit the file with this suffix'' option.
This option takes an argument string @file{suffix}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@item
must not appear in combination with any of the following options:
select-suffix.
@end itemize

Pass-through AutoGen argument
@subsubheading select-suffix option (-o).
@anchor{xml2ag select-suffix}
@cindex xml2ag-select-suffix

This is the ``specify this output suffix'' option.
This option takes an argument string @file{suffix}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading define option (-D).
@anchor{xml2ag define}
@cindex xml2ag-define

This is the ``name to add to definition list'' option.
This option takes an argument string @file{value}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading undefine option (-U).
@anchor{xml2ag undefine}
@cindex xml2ag-undefine

This is the ``definition list removal pattern'' option.
This option takes an argument string @file{name-pat}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@subsubheading make-dep option (-M).
@anchor{xml2ag make-dep}
@cindex xml2ag-make-dep

This is the ``emit make dependency file'' option.
This option takes an optional argument string @file{type}.

@noindent
This option has some usage constraints.  It:
@itemize @bullet
@item
may appear an unlimited number of times.
@end itemize

Pass-through AutoGen argument
@node xml2ag exit status
@subsection xml2ag exit status

One of the following exit values will be returned:
@table @samp
@item 0 (EXIT_SUCCESS)
Successful program execution.
@item 1 (EXIT_OPTION_ERROR)
The command options were misconfigured.
@item 2 (EXIT_BAD_TEMPLATE)
An error was encountered processing the template.
@item 3 (EXIT_BAD_DEFINITIONS)
The definitions could not be deciphered.
@item 4 (EXIT_LOAD_ERROR)
An error was encountered during the load phase.
@item 5 (EXIT_SIGNAL)
Program exited due to catching a signal.  If your template includes
string formatting, a number argument to a "%s" formatting element will
trigger a segmentation fault.  Autogen will catch the seg fault signal
and exit with @code{AUTOGEN_EXIT_SIGNAL(5)}.  Alternatively, AutoGen
may have been interrupted with a @code{kill(2)} signal.
@end table