@ignore
\internalpagesizes{46\baselineskip}{6in}{-.25in}{-.25in}{\bindingoffset}{36pt}%
@end ignore
@c %**start of header
@setfilename agdoc.info
@settitle AutoGen - The Automated Program Generator
@setchapternewpage off
@syncodeindex pg cp
@c %**end of header
@copying
This manual is for GNU AutoGen version 5.10, updated May 2010.

Copyright @copyright{} 1992-2009 by Bruce Korb.

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
@end quotation
@end copying

@ignore
EDIT THIS FILE WITH CAUTION  (agdoc.texi)

It has been AutoGen-ed  May , 2010 at  by AutoGen 5.10.1
From the definitions    /usr/src/autogen/_build/doc/ag-texi-5268.d/agdoc.def
and the template file   auto_gen.tpl

Plus bits and pieces gathered from all over the source/build
directories:


@end ignore

@dircategory GNU programming tools
@direntry
* AutoGen: (autogen).         The Automated Program Generator
@end direntry

@ifinfo
@ifnothtml
This file documents GNU AutoGen Version 5.10.

AutoGen copyright @copyright{} 1992-2009 Bruce Korb
AutoOpts copyright @copyright{} 1992-2009 Bruce Korb
snprintfv copyright @copyright{} 1999-2000 Gary V. Vaughan

AutoGen is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

AutoGen is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.

@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph.
@end ignore
@end ifnothtml
@end ifinfo

@finalout
@titlepage
@title AutoGen - The Automated Program Generator
@subtitle For version 5.10, May 2010
@author Bruce Korb
@author @email{bkorb@@gnu.org}

@page
@vskip 0pt plus 1filll
AutoGen copyright @copyright{} 1992-2009 Bruce Korb
@sp 2
This is the second edition of the GNU AutoGen documentation,
@sp 2
Published by Bruce Korb, 910 Redwood Dr., Santa Cruz, CA  95060

AutoGen is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

AutoGen is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.

@insertcopying
@end titlepage

@ifinfo

@node Top, Introduction, , (dir)
@top The Automated Program Generator
@comment  node-name,  next,  previous,  up

This file documents AutoGen version 5.10.  It is a tool designed
for generating program files that contain repetitive text with varied
substitutions.  This document is very long because it is intended as a
reference document.  For a quick start example, @xref{Example Usage}.

The AutoGen distribution includes the basic generator engine and
several add-on libraries and programs.  Of the most general interest
would be Automated Option processing, @xref{AutoOpts}, which also
includes stand-alone support for configuration file parsing, @xref{Features}.
Please see the ``Add-on packages for AutoGen'' section for additional
programs and libraries associated with AutoGen.

This edition documents version 5.10, May 2010.

@samp{#ident}, @samp{#let}, @samp{#pragma},  and @samp{#if}.
Note that when ignoring the @code{#if} directive, all intervening
text through its matching @code{#endif} is also ignored,
including the @code{#else} clause.

The AutoGen directives that affect the processing of
definitions are:

@table @code
@item #assert `shell-script` | (scheme-expr) | <anything else>
@cindex #assert
@cindex assert directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 404.
@end ignore
If the @code{shell-script} or @code{scheme-expr} do not yield @code{true}
valued results, autogen will be aborted.  If @code{<anything else>} or
nothing at all is provided, then this directive is ignored.

When writing the shell script, remember this is on a preprocessing
line.  Multiple lines must be backslash continued and the result is a
single long line.  Separate multiple commands with semi-colons.

The result is @code{false} (and fails) if the result is empty, the
number zero, or a string that starts with the letters 'n' or 'f' ("no"
or "false").

@item #define name [ <text> ]
@cindex #define
@cindex define directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 469.
@end ignore
Will add the name to the define list as if it were a DEFINE program
argument.  Its value will be the first non-whitespace token following
the name.  Quotes are @strong{not} processed.

After the definitions file has been processed, any remaining entries
in the define list will be added to the environment.

@item #elif
@cindex #elif
@cindex elif directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 541.
@end ignore
This must follow an @code{#if}
otherwise it will generate an error.
It will be ignored.

@item #else
@cindex #else
@cindex else directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 560.
@end ignore
This must follow an @code{#if}, @code{#ifdef} or @code{#ifndef}.
If it follows the @code{#if}, then it will be ignored.  Otherwise,
it will change the processing state to the reverse of what it was.

@item #endif
@cindex #endif
@cindex endif directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 578.
@end ignore
This must follow an @code{#if}, @code{#ifdef} or @code{#ifndef}.
In all cases, this will resume normal processing of text.

@item #endmac
@cindex #endmac
@cindex endmac directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 595.
@end ignore
This terminates a "macdef", but must not ever be encountered directly.

@item #endshell
@cindex #endshell
@cindex endshell directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 610.
@end ignore
Ends the text processed by a command shell into autogen definitions.

@item #error [ <descriptive text> ]
@cindex #error
@cindex error directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 629.
@end ignore
This directive will cause AutoGen to stop processing
and exit with a status of EXIT_FAILURE.


@item #if [ <ignored conditional expression> ]
@cindex #if
@cindex if directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 653.
@end ignore
@code{#if} expressions are not analyzed.  @strong{Everything} from here
to the matching @code{#endif} is skipped.

@item #ifdef name-to-test
@cindex #ifdef
@cindex ifdef directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 668.
@end ignore
The definitions that follow, up to the matching @code{#endif} will be
processed only if there is a corresponding @code{-Dname} command line
option or if a @code{#define} of that name has been previously encountered.

@item #ifndef name-to-test
@cindex #ifndef
@cindex ifndef directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 687.
@end ignore
The definitions that follow, up to the matching @code{#endif} will be
processed only if there is @strong{not} a corresponding @code{-Dname}
command line option or there was a canceling @code{-Uname} option.

@item #include unadorned-file-name
@cindex #include
@cindex include directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 706.
@end ignore
This directive will insert definitions from another file into
the current collection.  If the file name is adorned with
double quotes or angle brackets (as in a C program), then the
include is ignored.


@item #line
@cindex #line
@cindex line directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 823.
@end ignore
Alters the current line number and/or file name.  You may wish to
use this directive if you extract definition source from other files.
@command{getdefs} uses this mechanism so AutoGen will report the correct
file and approximate line number of any errors found in extracted
definitions.

@item #macdef
@cindex #macdef
@cindex macdef directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 867.
@end ignore
This is a new AT&T research preprocessing directive.  Basically, it is
a multi-line #define that may include other preprocessing directives.

@item #option opt-name [ <text> ]
@cindex #option
@cindex option directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 880.
@end ignore
This directive will pass the option name and associated text to the
AutoOpts optionLoadLine routine (@pxref{libopts-optionLoadLine}).  The
option text may span multiple lines by continuing them with a backslash.
The backslash/newline pair will be replaced with two space characters.
This directive may be used to set a search path for locating template files
For example, this:

@example
#option templ-dirs $ENVVAR/dirname
@end example
@noindent
will direct autogen to use the @code{ENVVAR} environment variable to find
a directory named @code{dirname} that (may) contain templates.  Since these
directories are searched in most recently supplied first order, search
directories supplied in this way will be searched before any supplied on
the command line.


@item #shell
@cindex #shell
@cindex shell directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 917.
@end ignore
Invokes @code{$SHELL} or @file{/bin/sh} on a script that should
generate AutoGen definitions.  It does this using the same server
process that handles the back-quoted @code{`} text.
@strong{CAUTION}@:  let not your @code{$SHELL} be @code{csh}.

@item #undef name-to-undefine
@cindex #undef
@cindex undef directive

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/defDirect.c line 1017.
@end ignore
Will remove any entries from the define list
that match the undef name pattern.
@end table

@node    Full Syntax
@section Finite State Machine Grammar

The preprocessing directives and comments are not part of the grammar.  They
are handled by the scanner/lexer.  The following was extracted directly from
the generated defParse-fsm.c source file.  The "EVT:" is the token seen,
the "STATE:" is the current state and the entries in this table describe
the next state and the action to take.  Invalid transitions were removed
from the table.

@ignore
Extracted from $top_srcdir/agen5/defParse.y
@end ignore
@example
dp_trans_table[ DP_STATE_CT ][ DP_EVENT_CT ] = @{

  /* STATE 0:  DP_ST_INIT */
  @{ @{ DP_ST_NEED_DEF, NULL @},                       /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 1:  DP_ST_NEED_DEF */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_NEED_TPL, NULL @},                       /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 2:  DP_ST_NEED_TPL */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_NEED_SEMI, dp_do_tpl_name @},            /* EVT:  var_name */
    @{ DP_ST_NEED_SEMI, dp_do_tpl_name @},            /* EVT:  other_name */
    @{ DP_ST_NEED_SEMI, dp_do_tpl_name @},            /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 3:  DP_ST_NEED_SEMI */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_NEED_NAME, NULL @},                      /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 4:  DP_ST_NEED_NAME */
  @{ @{ DP_ST_NEED_DEF, NULL @},                       /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_DONE, dp_do_need_name_end @},            /* EVT:  End-Of-File */
    @{ DP_ST_HAVE_NAME, dp_do_need_name_var_name @},  /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_HAVE_VALUE, dp_do_end_block @},          /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 5:  DP_ST_HAVE_NAME */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_NEED_NAME, dp_do_empty_val @},           /* EVT:  ; */
    @{ DP_ST_NEED_VALUE, dp_do_have_name_lit_eq @},   /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_NEED_IDX, NULL @},                       /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 6:  DP_ST_NEED_VALUE */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_HAVE_VALUE, dp_do_str_value @},          /* EVT:  var_name */
    @{ DP_ST_HAVE_VALUE, dp_do_str_value @},          /* EVT:  other_name */
    @{ DP_ST_HAVE_VALUE, dp_do_str_value @},          /* EVT:  string */
    @{ DP_ST_HAVE_VALUE, dp_do_str_value @},          /* EVT:  here_string */
    @{ DP_ST_HAVE_VALUE, dp_do_str_value @},          /* EVT:  number */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_NEED_NAME, dp_do_start_block @},         /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 7:  DP_ST_NEED_IDX */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_NEED_CBKT, dp_do_indexed_name @},        /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_NEED_CBKT, dp_do_indexed_name @},        /* EVT:  number */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 8:  DP_ST_NEED_CBKT */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INDX_NAME, NULL @}                       /* EVT:  ] */

  /* STATE 9:  DP_ST_INDX_NAME */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_NEED_NAME, dp_do_empty_val @},           /* EVT:  ; */
    @{ DP_ST_NEED_VALUE, NULL @},                     /* EVT:  = */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */

  /* STATE 10:  DP_ST_HAVE_VALUE */
  @{ @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  autogen */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  definitions */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  End-Of-File */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  var_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  other_name */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  here_string */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  number */
    @{ DP_ST_NEED_NAME, NULL @},                      /* EVT:  ; */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  = */
    @{ DP_ST_NEED_VALUE, dp_do_next_val @},           /* EVT:  , */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @{ */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  @} */
    @{ DP_ST_INVALID, dp_do_invalid @},               /* EVT:  [ */
    @{ DP_ST_INVALID, dp_do_invalid @}                /* EVT:  ] */
@end example

@ignore

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

@end ignore
@page
@node AutoGen Functions
@section AutoGen Scheme Functions

AutoGen uses Guile to interpret Scheme expressions within AutoGen
macros.  All of the normal Guile functions are available, plus several
extensions (@pxref{Common Functions}) have been added to
augment the repertoire of string manipulation functions and
manage the state of AutoGen processing.

This section describes those functions that are specific to AutoGen.
Please take note that these AutoGen specific functions are not loaded
and thus not made available until after the command line options have
been processed and the AutoGen definitions have been loaded.  They may,
of course, be used in Scheme functions that get defined at those times,
but they cannot be invoked.

@menu
* SCM ag-function?::       @file{ag-function?} - test for function
* SCM base-name::          @file{base-name} - base output name
* SCM chdir::              @file{chdir} - Change current directory
* SCM count::              @file{count} - definition count
* SCM def-file::           @file{def-file} - definitions file name
* SCM def-file-line::      @file{def-file-line} - get a definition file+line number
* SCM dne::                @file{dne} - "Do Not Edit" warning
* SCM error::              @file{error} - display message and exit
* SCM exist?::             @file{exist?} - test for value name
* SCM find-file::          @file{find-file} - locate a file in the search path
* SCM first-for?::         @file{first-for?} - detect first iteration
* SCM for-by::             @file{for-by} - set iteration step
* SCM for-from::           @file{for-from} - set initial index
* SCM for-index::          @file{for-index} - get current loop index
* SCM for-sep::            @file{for-sep} - set loop separation string
* SCM for-to::             @file{for-to} - set ending index
* SCM get::                @file{get} - get named value
* SCM get-c-name::         @file{get-c-name} - get named value, mapped to C name syntax
* SCM get-down-name::      @file{get-down-name} - get lower cased named value, mapped to C name syntax
* SCM get-up-name::        @file{get-up-name} - get upper cased named value, mapped to C name syntax
* SCM high-lim::           @file{high-lim} - get highest value index
* SCM last-for?::          @file{last-for?} - detect last iteration
* SCM len::                @file{len} - get count of values
* SCM low-lim::            @file{low-lim} - get lowest value index
* SCM make-header-guard::  @file{make-header-guard} - make self-inclusion guard
* SCM match-value?::       @file{match-value?} - test for matching value
* SCM out-delete::         @file{out-delete} - delete current output file
* SCM out-depth::          @file{out-depth} - output file stack depth
* SCM out-emit-suspended:: @file{out-emit-suspended} - emit the text of suspended output
* SCM out-line::           @file{out-line} - output file line number
* SCM out-move::           @file{out-move} - change name of output file
* SCM out-name::           @file{out-name} - current output file name
* SCM out-pop::            @file{out-pop} - close current output file
* SCM out-push-add::       @file{out-push-add} - append output to file
* SCM out-push-new::       @file{out-push-new} - purge and create output file
* SCM out-resume::         @file{out-resume} - resume suspended output file
* SCM out-suspend::        @file{out-suspend} - suspend current output file
* SCM out-switch::         @file{out-switch} - close and create new output
* SCM set-option::         @file{set-option} - Set a command line option
* SCM set-writable::       @file{set-writable} - Make the output file be writable
* SCM stack::              @file{stack} - make list of AutoGen values
* SCM suffix::             @file{suffix} - get the current suffix
* SCM tpl-file::           @file{tpl-file} - get the template file name
* SCM tpl-file-line::      @file{tpl-file-line} - get the template file+line number
* SCM autogen-version::     @file{autogen-version} - ``5.10.1''
* SCM c-file-line-fmt::     format file info as, ``@code{#line nn "file"}''
@end menu


@node SCM ag-function?
@subsection @file{ag-function?} - test for function
@findex ag-function?

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 406.
@end ignore
Usage:  (ag-function? ag-name)
@*
return SCM_BOOL_T if a specified name is a user-defined AutoGen
macro, otherwise return SCM_BOOL_F.

Arguments:
@*
ag-name - name of AutoGen macro

@node SCM base-name
@subsection @file{base-name} - base output name
@findex base-name

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 208.
@end ignore
Usage:  (base-name)
@*
Returns a string containing the base name of the output file(s).
Generally, this is also the base name of the definitions file.

This Scheme function takes no arguments.

@node SCM chdir
@subsection @file{chdir} - Change current directory
@findex chdir

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 303.
@end ignore
Usage:  (chdir dir)
@*
Sets the current directory for AutoGen.  Shell commands will run
from this directory as well.  This is a wrapper around the Guile
native function.  It returns its directory name argument and
fails the program on failure.

Arguments:
@*
dir - new directory name

@node SCM count
@subsection @file{count} - definition count
@findex count

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 335.
@end ignore
Usage:  (count ag-name)
@*
Count the number of entries for a definition.
The input argument must be a string containing the name
of the AutoGen values to be counted.  If there is no
value associated with the name, the result is an SCM
immediate integer value of zero.

Arguments:
@*
ag-name - name of AutoGen value

@node SCM def-file
@subsection @file{def-file} - definitions file name
@findex def-file

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 356.
@end ignore
Usage:  (def-file)
@*
Get the name of the definitions file.
Returns the name of the source file containing the AutoGen
definitions.

This Scheme function takes no arguments.

@node SCM def-file-line
@subsection @file{def-file-line} - get a definition file+line number
@findex def-file-line

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 773.
@end ignore
Usage:  (def-file-line ag-name [ msg-fmt ])
@*
Returns the file and line number of a AutoGen defined value, using
either the default format, "from %s line %d", or else the format you
supply.  For example, if you want to insert a "C" language file-line
directive, you would supply the format "# %2$d \"%1$s\"", but that
is also already supplied with the scheme variable
@xref{SCM c-file-line-fmt}.  You may use it thus:

@example
(def-file-line "ag-def-name" c-file-line-fmt)
@end example

It is also safe to use the formatting string, "%2$d".  AutoGen uses
an argument vector version of printf: @xref{snprintfv}.

Arguments:
@*
ag-name - name of AutoGen value
@*
msg-fmt - Optional - formatting for line message

@node SCM dne
@subsection @file{dne} - "Do Not Edit" warning
@findex dne

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expFormat.c line 113.
@end ignore
Usage:  (dne prefix [ first_prefix ] [ optpfx ])
@*
Generate a "DO NOT EDIT" or "EDIT WITH CARE" warning string.
Which depends on whether or not the @code{--writable} command line
option was set.

The first argument may be an option:  -d
This will suppress the variable text (date and version information).
If specified, then the "prefix" and "first" arguments are shifted
to the next arguments.

The first argument is a per-line string prefix.
The optional second argument is a prefix for the first-line and,
in read-only mode, activates the editor hints.
@*
@example
-*- buffer-read-only: t -*- vi: set ro:
@end example
@noindent
The warning string also includes information about the template used
to construct the file and the definitions used in its instantiation.

The optional third argument is used when the first argument is actually
an invocation option and the prefix arguments get shifted.
The first argument must be, specifically, "@code{-d}".  That is used
to signify that the date stamp should not be inserted into the output.

Arguments:
@*
prefix - string for starting each output line
@*
first_prefix - Optional - for the first output line
@*
optpfx - Optional - shifted prefix

@node SCM error
@subsection @file{error} - display message and exit
@findex error

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expFormat.c line 232.
@end ignore
Usage:  (error message)
@*
The argument is a string that printed out as part of an error
message.  The message is formed from the formatting string:

@example
DEFINITIONS ERROR in %s line %d for %s:  %s\n
@end example

The first three arguments to this format are provided by the
routine and are:  The name of the template file, the line within
the template where the error was found, and the current output
file name.

After displaying the message, the current output file is removed
and autogen exits with the EXIT_FAILURE error code.  IF, however,
the argument begins with the number 0 (zero), or the string is the
empty string, then processing continues with the next suffix.

Arguments:
@*
message - message to display before exiting

@node SCM exist?
@subsection @file{exist?} - test for value name
@findex exist?

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 371.
@end ignore
Usage:  (exist? ag-name)
@*
return SCM_BOOL_T iff a specified name has an AutoGen value.
The name may include indexes and/or member names.
All but the last member name must be an aggregate definition.
For example:
@example
(exist? "foo[3].bar.baz")
@end example
will yield true if all of the following is true:
@*
There is a member value of either group or string type
named @code{baz} for some group value @code{bar} that
is a member of the @code{foo} group with index @code{3}.
There may be multiple entries of @code{bar} within
@code{foo}, only one needs to contain a value for @code{baz}.

Arguments:
@*
ag-name - name of AutoGen value

@node SCM find-file
@subsection @file{find-file} - locate a file in the search path
@findex find-file

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expExtract.c line 313.
@end ignore
Usage:  (find-file file-name [ suffix ])
@*
AutoGen has a search path that it uses to locate template and definition
files.  This function will search the same list for @file{file-name}, both
with and without the @file{.suffix}, if provided.

Arguments:
@*
file-name - name of file with text
@*
suffix - Optional - file suffix to try, too

@node SCM first-for?
@subsection @file{first-for?} - detect first iteration
@findex first-for?

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 54.
@end ignore
Usage:  (first-for? [ for_var ])
@*
Returns SCM_BOOL_T if the named FOR loop (or, if not named, the
current innermost loop) is on the first pass through the data.
Outside of any FOR loop, it returns SCM_UNDEFINED.
@xref{FOR}.

Arguments:
@*
for_var - Optional - which for loop

@node SCM for-by
@subsection @file{for-by} - set iteration step
@findex for-by

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 205.
@end ignore
Usage:  (for-by by)
@*
This function records the "step by" information
for an AutoGen FOR function.
Outside of the FOR macro itself, this function will emit an error.
@xref{FOR}.

Arguments:
@*
by - the iteration increment for the AutoGen FOR macro

@node SCM for-from
@subsection @file{for-from} - set initial index
@findex for-from

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 165.
@end ignore
Usage:  (for-from from)
@*
This function records the initial index information
for an AutoGen FOR function.
Outside of the FOR macro itself, this function will emit an error.
@xref{FOR}.

Arguments:
@*
from - the initial index for the AutoGen FOR macro

@node SCM for-index
@subsection @file{for-index} - get current loop index
@findex for-index

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 128.
@end ignore
Usage:  (for-index [ for_var ])
@*
Returns the current index for the named FOR loop.
If not named, then the index for the innermost loop.
Outside of any FOR loop, it returns SCM_UNDEFINED.
@xref{FOR}.

Arguments:
@*
for_var - Optional - which for loop

@node SCM for-sep
@subsection @file{for-sep} - set loop separation string
@findex for-sep

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 225.
@end ignore
Usage:  (for-sep separator)
@*
This function records the separation string that is to be inserted
between each iteration of an AutoGen FOR function.  This is often
nothing more than a comma.
Outside of the FOR macro itself, this function will emit an error.

Arguments:
@*
separator - the text to insert between the output of
each FOR iteration

@node SCM for-to
@subsection @file{for-to} - set ending index
@findex for-to

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 185.
@end ignore
Usage:  (for-to to)
@*
This function records the terminating value information
for an AutoGen FOR function.
Outside of the FOR macro itself, this function will emit an error.
@xref{FOR}.

Arguments:
@*
to - the final index for the AutoGen FOR macro

@node SCM get
@subsection @file{get} - get named value
@findex get

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 462.
@end ignore
Usage:  (get ag-name [ alt-val ])
@*
Get the first string value associated with the name.
It will either return the associated string value (if
the name resolves), the alternate value (if one is provided),
or else the empty string.

Arguments:
@*
ag-name - name of AutoGen value
@*
alt-val - Optional - value if not present

@node SCM get-c-name
@subsection @file{get-c-name} - get named value, mapped to C name syntax
@findex get-c-name

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 495.
@end ignore
Usage:  (get-c-name ag-name)
@*
Get the first string value associated with the name.  It will either
return the associated string value (if the name resolves), the alternate
value (if one is provided), or else the empty string.  The result is
passed through "string->c-name!".

Arguments:
@*
ag-name - name of AutoGen value

@node SCM get-down-name
@subsection @file{get-down-name} - get lower cased named value, mapped to C name syntax
@findex get-down-name

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 545.
@end ignore
Usage:  (get-down-name ag-name)
@*
Get the first string value associated with the name.  It will either
return the associated string value (if the name resolves), the alternate
value (if one is provided), or else the empty string.  The result is
passed through "string->c-name!" and "string->down-case!".

Arguments:
@*
ag-name - name of AutoGen value

@node SCM get-up-name
@subsection @file{get-up-name} - get upper cased named value, mapped to C name syntax
@findex get-up-name

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 525.
@end ignore
Usage:  (get-up-name ag-name)
@*
Get the first string value associated with the name.  It will either
return the associated string value (if the name resolves), the alternate
value (if one is provided), or else the empty string.  The result is
passed through "string->c-name!" and "string->up-case!".

Arguments:
@*
ag-name - name of AutoGen value

@node SCM high-lim
@subsection @file{high-lim} - get highest value index
@findex high-lim

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 565.
@end ignore
Usage:  (high-lim ag-name)
@*
Returns the highest index associated with an array of definitions.
This is generally, but not necessarily, one less than the
@code{count} value.  (The indexes may be specified, rendering a
non-zero based or sparse array of values.)

This is very useful for specifying the size of a zero-based array
of values where not all values are present.  For example:

@example
tMyStruct myVals[ [+ (+ 1 (high-lim "my-val-list")) +] ];
@end example

Arguments:
@*
ag-name - name of AutoGen value

@node SCM last-for?
@subsection @file{last-for?} - detect last iteration
@findex last-for?

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 91.
@end ignore
Usage:  (last-for? [ for_var ])
@*
Returns SCM_BOOL_T if the named FOR loop (or, if not named, the
current innermost loop) is on the last pass through the data.
Outside of any FOR loop, it returns SCM_UNDEFINED.
@xref{FOR}.

Arguments:
@*
for_var - Optional - which for loop

@node SCM len
@subsection @file{len} - get count of values
@findex len

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 611.
@end ignore
Usage:  (len ag-name)
@*
If the named object is a group definition, then "len" is
the same as "count".  Otherwise, if it is one or more text
definitions, then it is the sum of their string lengths.
If it is a single text definition, then it is equivalent to
@code{(string-length (get "ag-name"))}.

Arguments:
@*
ag-name - name of AutoGen value

@node SCM low-lim
@subsection @file{low-lim} - get lowest value index
@findex low-lim

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 632.
@end ignore
Usage:  (low-lim ag-name)
@*
Returns the lowest index associated with an array of definitions.

Arguments:
@*
ag-name - name of AutoGen value

@node SCM make-header-guard
@subsection @file{make-header-guard} - make self-inclusion guard
@findex make-header-guard

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 656.
@end ignore
Usage:  (make-header-guard name)
@*
This function will create a @code{#ifndef}/@code{#define}
sequence for protecting a header from multiple evaluation.
It will also set the Scheme variable @code{header-file}
to the name of the file being protected and it will set
@code{header-guard} to the name of the @code{#define} being
used to protect it.  It is expected that this will be used
as follows:
@example
[+ (make-header-guard "group_name") +]
...
#endif /* [+ (. header-guard) +] */

#include "[+ (. header-file)  +]"
@end example
@noindent
The @code{#define} name is composed as follows:

@enumerate
@item
The first element is the string argument and a separating underscore.
@item
That is followed by the name of the header file with illegal
characters mapped to underscores.
@item
The end of the name is always, "@code{_GUARD}".
@item
Finally, the entire string is mapped to upper case.
@end enumerate

The final @code{#define} name is stored in an SCM symbol named
@code{header-guard}.  Consequently, the concluding @code{#endif} for the
file should read something like:

@example
#endif /* [+ (. header-guard) +] */
@end example

The name of the header file (the current output file) is also stored
in an SCM symbol, @code{header-file}.  Therefore, if you are also
generating a C file that uses the previously generated header file,
you can put this into that generated file:

@example
#include "[+ (. header-file) +]"
@end example

Obviously, if you are going to produce more than one header file from
a particular template, you will need to be careful how these SCM symbols
get handled.

Arguments:
@*
name - header group name

@node SCM match-value?
@subsection @file{match-value?} - test for matching value
@findex match-value?

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 428.
@end ignore
Usage:  (match-value? op ag-name test-str)
@*
This function answers the question, "Is there an AutoGen value named
@code{ag-name} with a value that matches the pattern @code{test-str}
using the match function @code{op}?"  Return SCM_BOOL_T iff at least
one occurrence of the specified name has such a value.  The operator
can be any function that takes two string arguments and yields a
boolean.  It is expected that you will use one of the string matching
functions provided by AutoGen.
@*
The value name must follow the same rules as the
@code{ag-name} argument for @code{exist?} (@pxref{SCM exist?}).

Arguments:
@*
op - boolean result operator
@*
ag-name - name of AutoGen value
@*
test-str - string to test against

@node SCM out-delete
@subsection @file{out-delete} - delete current output file
@findex out-delete

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 100.
@end ignore
Usage:  (out-delete)
@*
Remove the current output file.  Cease processing the template for
the current suffix.  It is an error if there are @code{push}-ed
output files.  Use the @code{(error "0")} scheme function instead.
@xref{output controls}.

This Scheme function takes no arguments.

@node SCM out-depth
@subsection @file{out-depth} - output file stack depth
@findex out-depth

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 592.
@end ignore
Usage:  (out-depth)
@*
Returns the depth of the output file stack.
@xref{output controls}.

This Scheme function takes no arguments.

@node SCM out-emit-suspended
@subsection @file{out-emit-suspended} - emit the text of suspended output
@findex out-emit-suspended

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 278.
@end ignore
Usage:  (out-emit-suspended suspName)
@*
This function is equivalent to
@code{(begin (out-resume <name>) (out-pop #t))}

Arguments:
@*
suspName - A name tag of suspended output

@node SCM out-line
@subsection @file{out-line} - output file line number
@findex out-line

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 622.
@end ignore
Usage:  (out-line)
@*
Returns the current line number of the output file.
It rewinds and reads the file to count newlines.

This Scheme function takes no arguments.

@node SCM out-move
@subsection @file{out-move} - change name of output file
@findex out-move

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 126.
@end ignore
Usage:  (out-move new-name)
@*
Rename current output file.  @xref{output controls}.
Please note: changing the name will not save a temporary
file from being deleted.  It @i{may}, however, be used on the
root output file.

Arguments:
@*
new-name - new name for the current output file

@node SCM out-name
@subsection @file{out-name} - current output file name
@findex out-name

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 605.
@end ignore
Usage:  (out-name)
@*
Returns the name of the current output file.  If the current file
is a temporary, unnamed file, then it will scan up the chain until
a real output file name is found.
@xref{output controls}.

This Scheme function takes no arguments.

@node SCM out-pop
@subsection @file{out-pop} - close current output file
@findex out-pop

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 155.
@end ignore
Usage:  (out-pop [ disp ])
@*
If there has been a @code{push} on the output, then close that
file and go back to the previously open file.  It is an error
if there has not been a @code{push}.  @xref{output controls}.

If there is no argument, no further action is taken.  Otherwise,
the argument should be @code{#t} and the contents of the file
are returned by the function.

Arguments:
@*
disp - Optional - return contents of the file

@node SCM out-push-add
@subsection @file{out-push-add} - append output to file
@findex out-push-add

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 419.
@end ignore
Usage:  (out-push-add file-name)
@*
Identical to @code{push-new}, except the contents are @strong{not}
purged, but appended to.  @xref{output controls}.

Arguments:
@*
file-name - name of the file to append text to

@node SCM out-push-new
@subsection @file{out-push-new} - purge and create output file
@findex out-push-new

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 443.
@end ignore
Usage:  (out-push-new [ file-name ])
@*
Leave the current output file open, but purge and create
a new file that will remain open until a @code{pop} @code{delete}
or @code{switch} closes it.  The file name is optional and, if omitted,
the output will be sent to a temporary file that will be deleted when
it is closed.
@xref{output controls}.

Arguments:
@*
file-name - Optional - name of the file to create

@node SCM out-resume
@subsection @file{out-resume} - resume suspended output file
@findex out-resume

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 242.
@end ignore
Usage:  (out-resume suspName)
@*
If there has been a suspended output, then make that output descriptor
current again.  That output must have been suspended with the same tag
name given to this routine as its argument.

Arguments:
@*
suspName - A name tag for reactivating

@node SCM out-suspend
@subsection @file{out-suspend} - suspend current output file
@findex out-suspend

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 198.
@end ignore
Usage:  (out-suspend suspName)
@*
If there has been a @code{push} on the output, then set aside the
output descriptor for later reactiviation with @code{(out-resume "xxx")}.
The tag name need not reflect the name of the output file.  In fact,
the output file may be an anonymous temporary file.  You may also
change the tag every time you suspend output to a file, because the
tag names are forgotten as soon as the file has been "resumed".

Arguments:
@*
suspName - A name tag for reactivating

@node SCM out-switch
@subsection @file{out-switch} - close and create new output
@findex out-switch

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 529.
@end ignore
Usage:  (out-switch file-name)
@*
Switch output files - close current file and make the current
file pointer refer to the new file.  This is equivalent to
@code{out-pop} followed by @code{out-push-new}, except that
you may not pop the base level output file, but you may
@code{switch} it.  @xref{output controls}.

Arguments:
@*
file-name - name of the file to create

@node SCM set-option
@subsection @file{set-option} - Set a command line option
@findex set-option

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 660.
@end ignore
Usage:  (set-option opt)
@*
The text argument must be an option name followed by any needed
option argument.  Returns SCM_UNDEFINED.

Arguments:
@*
opt - AutoGen option name + its argument

@node SCM set-writable
@subsection @file{set-writable} - Make the output file be writable
@findex set-writable

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcIf.c line 456.
@end ignore
Usage:  (set-writable [ set? ])
@*
This function will set the current output file to be writable
(or not).  This is only effective if neither the @code{--writable}
nor @code{--not-writable} have been specified.  This state
is reset when the current suffix's output is complete.

Arguments:
@*
set? - Optional - boolean arg, false to make output non-writable

@node SCM stack
@subsection @file{stack} - make list of AutoGen values
@findex stack

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 954.
@end ignore
Usage:  (stack ag-name)
@*
Create a scheme list of all the strings that are associated
with a name.  They must all be text values or we choke.

Arguments:
@*
ag-name - AutoGen value name

@node SCM suffix
@subsection @file{suffix} - get the current suffix
@findex suffix

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 677.
@end ignore
Usage:  (suffix)
@*
Returns the current active suffix (@pxref{pseudo macro}).

This Scheme function takes no arguments.

@node SCM tpl-file
@subsection @file{tpl-file} - get the template file name
@findex tpl-file

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 691.
@end ignore
Usage:  (tpl-file [ full_path ])
@*
Returns the name of the current template file.
If @code{#t} is passed in as an argument, then the template
file is hunted for in the template search path.  Otherwise,
just the unadorned name.

Arguments:
@*
full_path - Optional - include full path to file

@node SCM tpl-file-line
@subsection @file{tpl-file-line} - get the template file+line number
@findex tpl-file-line

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 716.
@end ignore
Usage:  (tpl-file-line [ msg-fmt ])
@*
Returns the file and line number of the current template macro using
either the default format, "from %s line %d", or else the format you
supply.  For example, if you want to insert a "C" language file-line
directive, you would supply the format "# %2$d \"%1$s\"", but that
is also already supplied with the scheme variable
@xref{SCM c-file-line-fmt}.  You may use it thus:
@example
(tpl-file-line c-file-line-fmt)
@end example

It is also safe to use the formatting string, "%2$d".  AutoGen uses
an argument vector version of printf: @xref{snprintfv}.

Arguments:
@*
msg-fmt - Optional - formatting for line message

@ignore
Generated from auto_gen.tpl line 258.
@end ignore

@node SCM autogen-version
@subsection @file{autogen-version} - autogen version number
@findex autogen-version

This is a symbol defining the current AutoGen version number string.
It was first defined in AutoGen-5.2.14.
It is currently ``5.10.1''.

@node SCM c-file-line-fmt
@subsection format file info as, ``@code{#line nn "file"}''
@findex c-file-line-fmt

This is a symbol that can easily be used with the functions
@xref{SCM tpl-file-line}, and @xref{SCM def-file-line}.
These will emit C program @code{#line} directives pointing to template
and definitions text, respectively.
@ignore

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

@end ignore
@page
@node Common Functions
@section Common Scheme Functions

This section describes a number of general purpose functions that make
the kind of string processing that AutoGen does a little easier.
Unlike the AutoGen specific functions (@pxref{AutoGen Functions}),
these functions are available for direct use during definition load time.
The equality test (@pxref{SCM =}) is ``overloaded'' to do string equivalence
comparisons.  If you are looking for inequality, the Scheme/Lisp way
of spelling that is, ``(not (= ...))''.

@menu
* SCM ag-fprintf::         @file{ag-fprintf} - format to autogen stream
* SCM agpl::               @file{agpl} - GNU Affero General Public License
* SCM bsd::                @file{bsd} - BSD Public License
* SCM c-string::           @file{c-string} - emit string for ANSI C
* SCM emit::               @file{emit} - emit the text for each argument
* SCM emit-string-table::  @file{emit-string-table} - output a string table
* SCM error-source-line::  @file{error-source-line} - display of file & line
* SCM extract::            @file{extract} - extract text from another file
* SCM format-arg-count::   @file{format-arg-count} - count the args to a format
* SCM fprintf::            @file{fprintf} - format to a file
* SCM gperf::              @file{gperf} - perform a perfect hash function
* SCM gperf-code::         @file{gperf-code} - emit the source of the generated gperf program
* SCM gpl::                @file{gpl} - GNU General Public License
* SCM hide-email::         @file{hide-email} - convert eaddr to javascript
* SCM html-escape-encode:: @file{html-escape-encode} - encode html special characters
* SCM in?::                @file{in?} - test for string in list
* SCM join::               @file{join} - join string list with separator
* SCM kr-string::          @file{kr-string} - emit string for K&R C
* SCM lgpl::               @file{lgpl} - GNU Library General Public License
* SCM license::            @file{license} - an arbitrary license
* SCM make-gperf::         @file{make-gperf} - build a perfect hash function program
* SCM makefile-script::    @file{makefile-script} - create makefile script
* SCM max::                @file{max} - maximum value in list
* SCM min::                @file{min} - minimum value in list
* SCM prefix::             @file{prefix} - prefix lines with a string
* SCM printf::             @file{printf} - format to stdout
* SCM raw-shell-str::      @file{raw-shell-str} - single quote shell string
* SCM shell::              @file{shell} - invoke a shell script
* SCM shell-str::          @file{shell-str} - double quote shell string
* SCM shellf::             @file{shellf} - format a string, run shell
* SCM sprintf::            @file{sprintf} - format a string
* SCM string-capitalize::  @file{string-capitalize} - capitalize a new string
* SCM string-capitalize!:: @file{string-capitalize!} - capitalize a string
* SCM *=*::                @file{string-contains-eqv?} - caseless substring
* SCM *==*::               @file{string-contains?} - substring match
* SCM string-downcase::    @file{string-downcase} - lower case a new string
* SCM string-downcase!::   @file{string-downcase!} - make a string be lower case
* SCM *~::                 @file{string-end-eqv-match?} - caseless regex ending
* SCM *~~::                @file{string-end-match?} - regex match end
* SCM *=::                 @file{string-ends-eqv?} - caseless string ending
* SCM *==::                @file{string-ends-with?} - string ending
* SCM ==::                 @file{string-equals?} - string matching
* SCM ~::                  @file{string-eqv-match?} - caseless regex match
* SCM =::                  @file{string-eqv?} - caseless string match
* SCM *~*::                @file{string-has-eqv-match?} - caseless regex contains
* SCM *~~*::               @file{string-has-match?} - contained regex match
* SCM ~~::                 @file{string-match?} - regex match
* SCM ~*::                 @file{string-start-eqv-match?} - caseless regex start
* SCM ~~*::                @file{string-start-match?} - regex match start
* SCM =*::                 @file{string-starts-eqv?} - caseless string start
* SCM ==*::                @file{string-starts-with?} - string starting
* SCM string-substitute::  @file{string-substitute} - multiple global replacements
* SCM string-table-add::   @file{string-table-add} - Add an entry to a string table
* SCM string-table-add-ref:: @file{string-table-add-ref} - Add an entry to a string table, get reference
* SCM string-table-new::   @file{string-table-new} - create a string table
* SCM string-table-size::  @file{string-table-size} - print the current size of a string table
* SCM string->c-name!::    @file{string->c-name!} - map non-name chars to underscore
* SCM string-tr::          @file{string-tr} - convert characters with new result
* SCM string-tr!::         @file{string-tr!} - convert characters
* SCM string-upcase::      @file{string-upcase} - upper case a new string
* SCM string-upcase!::     @file{string-upcase!} - make a string be upper case
* SCM sub-shell-str::      @file{sub-shell-str} - back quoted (sub-)shell string
* SCM sum::                @file{sum} - sum of values in list
* SCM time-string->number:: @file{time-string->number} - duration string to seconds
* SCM version-compare::    @file{version-compare} - compare two version numbers
@end menu


@node SCM ag-fprintf
@subsection @file{ag-fprintf} - format to autogen stream
@findex ag-fprintf

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expOutput.c line 294.
@end ignore
Usage:  (ag-fprintf ag-diversion format [ format-arg ... ])
@*
Format a string using arguments from the alist.
Write to a specified AutoGen diversion.
That may be either a specified suspended output stream
(@pxref{SCM out-suspend}) or an index into the output stack
(@pxref{SCM out-push-new}).  @code{(ag-fprintf 0 ...)} is
equivalent to @code{(emit (sprintf ...))}, and
@code{(ag-fprintf 1 ...)} sends output to the most recently
suspended output stream.

Arguments:
@*
ag-diversion - AutoGen diversion name or number
@*
format - formatting string
@*
format-arg - Optional - list of arguments to formatting string

@node SCM agpl
@subsection @file{agpl} - GNU Affero General Public License
@findex agpl

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expFormat.c line 379.
@end ignore
Usage:  (agpl prog-name prefix)
@*
Emit a string that contains the GNU Affero General Public License.
It takes two arguments:
@code{prefix} contains the string to start each output line, and
@code{prog_name} contains the name of the program the copyright is
about.

Arguments:
@*
prog-name - name of the program under the GPL
@*
prefix - String for starting each output line

@node SCM bsd
@subsection @file{bsd} - BSD Public License
@findex bsd

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expFormat.c line 475.
@end ignore
Usage:  (bsd prog_name owner prefix)
@*
Emit a string that contains the Free BSD Public License.
It takes three arguments:
@code{prefix} contains the string to start each output line.
@code{owner} contains the copyright owner.
@code{prog_name} contains the name of the program the copyright is about.

Arguments:
@*
prog_name - name of the program under the BSD
@*
owner - Grantor of the BSD License
@*
prefix - String for starting each output line

@node SCM c-string
@subsection @file{c-string} - emit string for ANSI C
@findex c-string

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 1020.
@end ignore
Usage:  (c-string string)
@*
Reform a string so that, when printed, the C compiler will be able to
compile the data and construct a string that contains exactly what the
current string contains.  Many non-printing characters are replaced with
escape sequences.  Newlines are replaced with a backslash, an @code{n}, a
closing quote, a newline, seven spaces and another re-opening quote.  The
compiler will implicitly concatenate them.  The reader will see line
breaks.

A K&R compiler will choke.  Use @code{kr-string} for that compiler.

Arguments:
@*
string - string to reformat

@node SCM emit
@subsection @file{emit} - emit the text for each argument
@findex emit

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcEval.c line 300.
@end ignore
Usage:  (emit alist ...)
@*
Walk the tree of arguments, displaying the values of displayable
SCM types.  EXCEPTION: if the first argument is a number, then
that number is used to index the output stack.  "0" is the default,
the current output.

Arguments:
@*
alist - list of arguments to stringify and emit

@node SCM emit-string-table
@subsection @file{emit-string-table} - output a string table
@findex emit-string-table

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/schemedef.scm line 279.
@end ignore
Usage:  (emit-string-table st-name)
@*
Emit into the current output stream a
@code{static char const} array named @code{st-name}
that will have @code{NUL} bytes between each inserted string.

Arguments:
@*
st-name - the name of the array of characters

@node SCM error-source-line
@subsection @file{error-source-line} - display of file & line
@findex error-source-line

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcEval.c line 278.
@end ignore
Usage:  (error-source-line)
@*
This function is only invoked just before Guile displays
an error message.  It displays the file name and line number
that triggered the evaluation error.  You should not need to
invoke this routine directly.  Guile will do it automatically.

This Scheme function takes no arguments.

@node SCM extract
@subsection @file{extract} - extract text from another file
@findex extract

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expExtract.c line 186.
@end ignore
Usage:  (extract file-name marker-fmt [ caveat ] [ default ])
@*
This function is used to help construct output files that may contain
text that is carried from one version of the output to the next.

The first two arguments are required, the second are optional:

@itemize @bullet
@item
The @code{file-name} argument is used to name the file that
contains the demarcated text.
@item
The @code{marker-fmt} is a formatting string that is used to construct
the starting and ending demarcation strings.  The sprintf function is
given the @code{marker-fmt} with two arguments.  The first is either
"START" or "END".  The second is either "DO NOT CHANGE THIS COMMENT"
or the optional @code{caveat} argument.
@item
@code{caveat} is presumed to be absent if it is the empty string
(@code{""}).  If absent, ``DO NOT CHANGE THIS COMMENT'' is used
as the second string argument to the @code{marker-fmt}.
@item
When a @code{default} argument is supplied and no pre-existing text
is found, then this text will be inserted between the START and END
markers.
@end itemize

@noindent
The resulting strings are presumed to be unique within
the subject file.  As a simplified example:

@example
[+ (extract "fname" "// %s - SOMETHING - %s" ""
"example default") +]
@end example
@noindent
will result in the following text being inserted into the output:

@example
// START - SOMETHING - DO NOT CHANGE THIS COMMENT
example default
// END   - SOMETHING - DO NOT CHANGE THIS COMMENT
@end example

@noindent
The ``@code{example default}'' string can then be carried forward to
the next generation of the output, @strong{@i{provided}} the output
is not named "@code{fname}" @i{and} the old output is renamed to
"@code{fname}" before AutoGen-eration begins.

@table @strong
@item NB:
You can set aside previously generated source files inside the pseudo
macro with a Guile/scheme function, extract the text you want to keep
with this extract function.  Just remember you should delete it at the
end, too.  Here is an example from my Finite State Machine generator:

@example
[+ AutoGen5 Template  -*- Mode: text -*-
h=%s-fsm.h   c=%s-fsm.c
(shellf
"test -f %1$s-fsm.h && mv -f %1$s-fsm.h .fsm.head
test -f %1$s-fsm.c && mv -f %1$s-fsm.c .fsm.code" (base-name))
+]
@end example

This code will move the two previously produced output files to files
named ".fsm.head" and ".fsm.code".  At the end of the 'c' output
processing, I delete them.

@item also NB:
This function presumes that the output file ought to be editable so
that the code between the @code{START} and @code{END} marks can be edited
by the template user.  Consequently, when the @code{(extract ...)} function
is invoked, if the @code{writable} option has not been specified, then
it will be set at that point.  If this is not the desired behavior, the
@code{--not-writable} command line option will override this.
Also, you may use the guile function @code{(chmod "file" mode-value)}
to override whatever AutoGen is using for the result mode.
@end table

Arguments:
@*
file-name - name of file with text
@*
marker-fmt - format for marker text
@*
caveat - Optional - warn about changing marker
@*
default - Optional - default initial text

@node SCM format-arg-count
@subsection @file{format-arg-count} - count the args to a format
@findex format-arg-count

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expPrint.c line 309.
@end ignore
Usage:  (format-arg-count format)
@*
Sometimes, it is useful to simply be able to figure out how many
arguments are required by a format string.  For example, if you
are extracting a format string for the purpose of generating a
macro to invoke a printf-like function, you can run the
formatting string through this function to determine how many
arguments to provide for in the macro. e.g. for this extraction
text:
@example

 /*=fumble bumble
  * fmt: 'stumble %s: %d\n'
 =*/
@end example

@noindent
You may wish to generate a macro:
@example

 #define BUMBLE(a1,a2) printf_like(something,(a1),(a2))
@end example

@noindent
You can do this by knowing that the format needs two arguments.

Arguments:
@*
format - formatting string

@node SCM fprintf
@subsection @file{fprintf} - format to a file
@findex fprintf

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expPrint.c line 234.
@end ignore
Usage:  (fprintf port format [ format-arg ... ])
@*
Format a string using arguments from the alist.
Write to a specified port.  The result will NOT appear in your
output.  Use this to print information messages to a template user.

Arguments:
@*
port - Guile-scheme output port
@*
format - formatting string
@*
format-arg - Optional - list of arguments to formatting string

@node SCM gperf
@subsection @file{gperf} - perform a perfect hash function
@findex gperf

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGperf.c line 111.
@end ignore
Usage:  (gperf name str)
@*
Perform the perfect hash on the input string.  This is only useful if
you have previously created a gperf program with the @code{make-gperf}
function @xref{SCM make-gperf}.  The @code{name} you supply here must
match the name used to create the program and the string to hash must
be one of the strings supplied in the @code{make-gperf} string list.
The result will be a perfect hash index.

See the documentation for @command{gperf(1GNU)} for more details.

Arguments:
@*
name - name of hash list
@*
str - string to hash

@node SCM gperf-code
@subsection @file{gperf-code} - emit the source of the generated gperf program
@findex gperf-code

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/schemedef.scm line 322.
@end ignore
Usage:  (gperf-code st-name)
@*
Returns the contents of the emitted code, suitable
for inclusion in another program.  The interface contains
the following elements:

@table @samp
@item struct @i{<st-name>}_index
containg the fields: @code{@{char const * name, int const id; @};}

@item @i{<st-name>}_hash()
This is the hashing function with local only scope (static).

@item @i{<st-name>}_find()
This is the searching and validation function.  The first argument
is the string to look up, the second is its length.
It returns a pointer to the corresponding @code{@i{<st-name>}_index}
entry.
@end table

Use this in your template as follows where "@i{<st-name>}" was
set to be "@code{lookup}":

@example
[+ (make-gperf "lookup" (join "\n" (stack "name_list")))
(gperf-code "lookup") +]
void my_fun(char * str) @{
struct lookup_index * li = lookup_find(str, strlen(str));
if (li != NULL) printf("%s yields %d\n", str, li->idx);
@end example

Arguments:
@*
st-name - the name of the gperf hash list

@node SCM gpl
@subsection @file{gpl} - GNU General Public License
@findex gpl

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expFormat.c line 333.
@end ignore
Usage:  (gpl prog-name prefix)
@*
Emit a string that contains the GNU General Public License.
It takes two arguments:
@code{prefix} contains the string to start each output line, and
@code{prog_name} contains the name of the program the copyright is
about.

Arguments:
@*
prog-name - name of the program under the GPL
@*
prefix - String for starting each output line

@node SCM hide-email
@subsection @file{hide-email} - convert eaddr to javascript
@findex hide-email

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expPrint.c line 258.
@end ignore
Usage:  (hide-email display eaddr)
@*
Hides an email address as a java scriptlett.
The 'mailto:' tag and the email address are coded bytes
rather than plain text.  They are also broken up.

Arguments:
@*
display - display text
@*
eaddr - email address

@node SCM html-escape-encode
@subsection @file{html-escape-encode} - encode html special characters
@findex html-escape-encode

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/schemedef.scm line 112.
@end ignore
Usage:  (html-escape-encode str)
@*
This function will replace replace the characters @code{'&'},
@code{'<'} and @code{'>'} characters with the HTML/XML
escape-encoded strings (@code{"&amp;"}, @code{"&lt;"}, and
@code{"&gt;"}, respectively).

Arguments:
@*
str - string to make substitutions in

@node SCM in?
@subsection @file{in?} - test for string in list
@findex in?

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 453.
@end ignore
Usage:  (in? test-string string-list ...)
@*
Return SCM_BOOL_T if the first argument string is found
in one of the entries in the second (list-of-strings) argument.

Arguments:
@*
test-string - string to look for
@*
string-list - list of strings to check

@node SCM join
@subsection @file{join} - join string list with separator
@findex join

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 520.
@end ignore
Usage:  (join separator list ...)
@*
With the first argument as the separator string,
joins together an a-list of strings into one long string.
The list may contain nested lists, partly because you
cannot always control that.

Arguments:
@*
separator - string to insert between entries
@*
list - list of strings to join

@node SCM kr-string
@subsection @file{kr-string} - emit string for K&R C
@findex kr-string

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 996.
@end ignore
Usage:  (kr-string string)
@*
Reform a string so that, when printed, a K&R C compiler will be able
to compile the data and construct a string that contains exactly
what the current string contains.  Many non-printing characters are
replaced with escape sequences.  New-lines are replaced with a
backslash-n-backslash and newline sequence,

Arguments:
@*
string - string to reformat

@node SCM lgpl
@subsection @file{lgpl} - GNU Library General Public License
@findex lgpl

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expFormat.c line 425.
@end ignore
Usage:  (lgpl prog_name owner prefix)
@*
Emit a string that contains the GNU Library General Public License.
It takes three arguments:  @code{prefix} contains the string to
start each output line.  @code{owner} contains the copyright owner.
@code{prog_name} contains the name of the program the copyright is about.

Arguments:
@*
prog_name - name of the program under the LGPL
@*
owner - Grantor of the LGPL
@*
prefix - String for starting each output line

@node SCM license
@subsection @file{license} - an arbitrary license
@findex license

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expFormat.c line 532.
@end ignore
Usage:  (license lic_name prog_name owner prefix)
@*
Emit a string that contains the named license.  The license text
is read from a file named, @code{lic_name}.lic, searching the standard
directories.  The file contents are used as a format argument
to @code{printf}(3), with @code{prog_name} and @code{owner} as
the two string formatting arguments.  Each output line is automatically
prefixed with the string @code{prefix}.

Arguments:
@*
lic_name - file name of the license
@*
prog_name - name of the licensed program or library
@*
owner - Grantor of the License
@*
prefix - String for starting each output line

@node SCM make-gperf
@subsection @file{make-gperf} - build a perfect hash function program
@findex make-gperf

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGperf.c line 41.
@end ignore
Usage:  (make-gperf name strings ...)
@*
Build a program to perform perfect hashes of a known list of input
strings.  This function produces no output, but prepares a program
named, @file{gperf_<name>} for use by the gperf function
@xref{SCM gperf}.

This program will be obliterated as AutoGen exits.
However, you may incorporate the generated hashing function
into your C program with commands something like the following:

@example
[+ (shellf "sed '/^int main(/,$d;/^#line/d' $@{gpdir@}/%s.c"
name ) +]
@end example

where @code{name} matches the name provided to this @code{make-perf}
function.  @code{gpdir} is the variable used to store the name of the
temporary directory used to stash all the files.

Arguments:
@*
name - name of hash list
@*
strings - list of strings to hash

@node SCM makefile-script
@subsection @file{makefile-script} - create makefile script
@findex makefile-script

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expMake.c line 27.
@end ignore
Usage:  (makefile-script text)
@*
This function will take ordinary shell script text and reformat it
so that it will work properly inside of a makefile shell script.
Not every shell construct can be supported; the intent is to have
most ordinary scripts work without much, if any, alteration.

The following transformations are performed on the source text:

@enumerate
@item
Trailing whitespace on each line is stripped.

@item
Except for the last line, the string, " ; \\" is appended to the end of
every line that does not end with a backslash, semi-colon,
conjunction operator or pipe.  Note that this will mutilate multi-line
quoted strings, but @command{make} renders it impossible to use multi-line
constructs anyway.

@item
If the line ends with a backslash, it is left alone.

@item
If the line ends with one of the excepted operators, then a space and
backslash is added.

@item
The dollar sign character is doubled, unless it immediately precedes an
opening parenthesis or the single character make macros '*', '<', '@@',
'?' or '%'.  Other single character make macros that do not have enclosing
parentheses will fail.  For shell usage of the "$@@", "$?" and "$*"
macros, you must enclose them with curly braces, e.g., "$@{?@}".
The ksh construct @code{$(<command>)} will not work.  Though some
@command{make}s accept @code{$@{var@}} constructs, this function will
assume it is for shell interpretation and double the dollar character.
You must use @code{$(var)} for all @command{make} substitutions.

@item
Double dollar signs are replaced by four before the next character
is examined.

@item
Every line is prefixed with a tab, unless the first line
already starts with a tab.

@item
The newline character on the last line, if present, is suppressed.

@item
Blank lines are stripped.
@end enumerate

@noindent
This function is intended to be used approximately as follows:

@example
$(TARGET) : $(DEPENDENCIES)
<+ (out-push-new) +>
....mostly arbitrary shell script text....
<+ (makefile-script (out-pop #t)) +>
@end example

Arguments:
@*
text - the text of the script

@node SCM max
@subsection @file{max} - maximum value in list
@findex max

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 122.
@end ignore
Usage:  (max list ...)
@*
Return the maximum value in the list

Arguments:
@*
list - list of values.  Strings are converted to numbers

@node SCM min
@subsection @file{min} - minimum value in list
@findex min

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 182.
@end ignore
Usage:  (min list ...)
@*
Return the minimum value in the list

Arguments:
@*
list - list of values.  Strings are converted to numbers

@node SCM prefix
@subsection @file{prefix} - prefix lines with a string
@findex prefix

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 618.
@end ignore
Usage:  (prefix prefix text)
@*
Prefix every line in the second string with the first string.

For example, if the first string is "# " and the second contains:
@example
two
lines
@end example
@noindent
The result string will contain:
@example
# two
# lines
@end example

Arguments:
@*
prefix - string to insert at start of each line
@*
text - multi-line block of text

@node SCM printf
@subsection @file{printf} - format to stdout
@findex printf

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expPrint.c line 210.
@end ignore
Usage:  (printf format [ format-arg ... ])
@*
Format a string using arguments from the alist.
Write to the standard out port.  The result will NOT appear in your
output.  Use this to print information messages to a template user.
Use ``(sprintf ...)'' to add text to your document.

Arguments:
@*
format - formatting string
@*
format-arg - Optional - list of arguments to formatting string

@node SCM raw-shell-str
@subsection @file{raw-shell-str} - single quote shell string
@findex raw-shell-str

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 768.
@end ignore
Usage:  (raw-shell-str string)
@*
Convert the text of the string into a singly quoted string
that a normal shell will process into the original string.
(It will not do macro expansion later, either.)
Contained single quotes become tripled, with the middle quote
escaped with a backslash.  Normal shells will reconstitute the
original string.

@strong{Notice}:  some shells will not correctly handle unusual
non-printing characters.  This routine works for most reasonably
conventional ASCII strings.

Arguments:
@*
string - string to transform

@node SCM shell
@subsection @file{shell} - invoke a shell script
@findex shell

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 701.
@end ignore
Usage:  (shell command)
@*
Generate a string by writing the value to
a server shell and reading the output back in.  The template
programmer is responsible for ensuring that it completes
within 10 seconds.  If it does not, the server will be killed,
the output tossed and a new server started.

Arguments:
@*
command - shell command - the result value is stdout

@node SCM shell-str
@subsection @file{shell-str} - double quote shell string
@findex shell-str

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 865.
@end ignore
Usage:  (shell-str string)
@*
Convert the text of the string into a double quoted string that a normal
shell will process into the original string, almost.  It will add the
escape character @code{\\} before two special characters to
accomplish this: the backslash @code{\\} and double quote @code{"}.

@strong{NOTE}: some shells will not correctly handle unusual
non-printing characters.  This routine works for most reasonably
conventional ASCII strings.

@strong{WARNING}:
@*
This function omits the extra backslash in front of a backslash, however,
if it is followed by either a backquote or a dollar sign.  It must do this
because otherwise it would be impossible to protect the dollar sign or
backquote from shell evaluation.  Consequently, it is not possible to
render the strings "\\$" or "\\`".  The lesser of two evils.

All others characters are copied directly into the output.

The @code{sub-shell-str} variation of this routine behaves identically,
except that the extra backslash is omitted in front of @code{"} instead
of @code{`}.  You have to think about it.  I'm open to suggestions.

Meanwhile, the best way to document is with a detailed output example.
If the backslashes make it through the text processing correctly,
below you will see what happens with three example strings.  The first
example string contains a list of quoted @code{foo}s, the second is
the same with a single backslash before the quote characters and the
last is with two backslash escapes.  Below each is the result of the
@code{raw-shell-str}, @code{shell-str} and @code{sub-shell-str} functions.

@example
foo[0]           ''foo'' 'foo' "foo" `foo` $foo
raw-shell-str -> \'\''foo'\'\'' '\''foo'\'' "foo" `foo` $foo'
shell-str     -> "''foo'' 'foo' \"foo\" `foo` $foo"
sub-shell-str -> `''foo'' 'foo' "foo" \`foo\` $foo`

foo[1]           \'bar\' \"bar\" \`bar\` \$bar
raw-shell-str -> '\'\''bar\'\'' \"bar\" \`bar\` \$bar'
shell-str     -> "\\'bar\\' \\\"bar\\\" \`bar\` \$bar"
sub-shell-str -> `\\'bar\\' \"bar\" \\\`bar\\\` \$bar`

foo[2]           \\'BAZ\\' \\"BAZ\\" \\`BAZ\\` \\$BAZ
raw-shell-str -> '\\'\''BAZ\\'\'' \\"BAZ\\" \\`BAZ\\` \\$BAZ'
shell-str     -> "\\\\'BAZ\\\\' \\\\\"BAZ\\\\\" \\\`BAZ\\\` \\\$BAZ"
sub-shell-str -> `\\\\'BAZ\\\\' \\\"BAZ\\\" \\\\\`BAZ\\\\\` \\\$BAZ`
@end example

There should be four, three, five and three backslashes for the four
examples on the last line, respectively.  The next to last line should
have four, five, three and three backslashes.  If this was not accurately
reproduced, take a look at the agen5/test/shell.test test.  Notice the
backslashes in front of the dollar signs.  It goes from zero to one to
three for the "cooked" string examples.

Arguments:
@*
string - string to transform

@node SCM shellf
@subsection @file{shellf} - format a string, run shell
@findex shellf

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 736.
@end ignore
Usage:  (shellf format [ format-arg ... ])
@*
Format a string using arguments from the alist,
then send the result to the shell for interpretation.

Arguments:
@*
format - formatting string
@*
format-arg - Optional - list of arguments to formatting string

@node SCM sprintf
@subsection @file{sprintf} - format a string
@findex sprintf

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expPrint.c line 187.
@end ignore
Usage:  (sprintf format [ format-arg ... ])
@*
Format a string using arguments from the alist.

Arguments:
@*
format - formatting string
@*
format-arg - Optional - list of arguments to formatting string

@node SCM string-capitalize
@subsection @file{string-capitalize} - capitalize a new string
@findex string-capitalize

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 426.
@end ignore
Usage:  (string-capitalize str)
@*
Create a new SCM string containing the same text as the original,
only all the first letter of each word is upper cased and all
other letters are made lower case.

Arguments:
@*
str - input string

@node SCM string-capitalize!
@subsection @file{string-capitalize!} - capitalize a string
@findex string-capitalize!

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 383.
@end ignore
Usage:  (string-capitalize! str)
@*
capitalize all the words in an SCM string.

Arguments:
@*
str - input/output string

@node SCM *=*
@subsection @file{string-contains-eqv?} - caseless substring
@findex string-contains-eqv?
@findex *=*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 292.
@end ignore
Usage:  (*=* text match)
@*
string-contains-eqv?:  Test to see if a string contains an equivalent string.
`equivalent' means the strings match, but without regard
to character case and certain characters are considered `equivalent'.
Viz., '-', '_' and '^' are equivalent.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM *==*
@subsection @file{string-contains?} - substring match
@findex string-contains?
@findex *==*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 159.
@end ignore
Usage:  (*==* text match)
@*
string-contains?:  Test to see if a string contains a substring.  "strstr(3)"
will find an address.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM string-downcase
@subsection @file{string-downcase} - lower case a new string
@findex string-downcase

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 481.
@end ignore
Usage:  (string-downcase str)
@*
Create a new SCM string containing the same text as the original,
only all the upper case letters are changed to lower case.

Arguments:
@*
str - input string

@node SCM string-downcase!
@subsection @file{string-downcase!} - make a string be lower case
@findex string-downcase!

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 450.
@end ignore
Usage:  (string-downcase! str)
@*
Change to lower case all the characters in an SCM string.

Arguments:
@*
str - input/output string

@node SCM *~
@subsection @file{string-end-eqv-match?} - caseless regex ending
@findex string-end-eqv-match?
@findex *~

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 552.
@end ignore
Usage:  (*~ text match)
@*
string-end-eqv-match?:  Test to see if a string ends with a pattern.
Case is not significant.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM *~~
@subsection @file{string-end-match?} - regex match end
@findex string-end-match?
@findex *~~

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 539.
@end ignore
Usage:  (*~~ text match)
@*
string-end-match?:  Test to see if a string ends with a pattern.
Case is significant.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM *=
@subsection @file{string-ends-eqv?} - caseless string ending
@findex string-ends-eqv?
@findex *=

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 341.
@end ignore
Usage:  (*= text match)
@*
string-ends-eqv?:  Test to see if a string ends with an equivalent string.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM *==
@subsection @file{string-ends-with?} - string ending
@findex string-ends-with?
@findex *==

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 188.
@end ignore
Usage:  (*== text match)
@*
string-ends-with?:  Test to see if a string ends with a substring.
strcmp(3) returns zero for comparing the string ends.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM ==
@subsection @file{string-equals?} - string matching
@findex string-equals?
@findex ==

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 263.
@end ignore
Usage:  (== text match)
@*
string-equals?:  Test to see if two strings exactly match.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM ~
@subsection @file{string-eqv-match?} - caseless regex match
@findex string-eqv-match?
@findex ~

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 738.
@end ignore
Usage:  (~ text match)
@*
string-eqv-match?:  Test to see if a string fully matches a pattern.
Case is not significant, but any character equivalences
must be expressed in your regular expression.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM =
@subsection @file{string-eqv?} - caseless string match
@findex string-eqv?
@findex =

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 411.
@end ignore
Usage:  (= text match)
@*
string-eqv?:  Test to see if two strings are equivalent.  `equivalent' means the
strings match, but without regard to character case and certain
characters are considered `equivalent'.  Viz., '-', '_' and '^' are
equivalent.  If the arguments are not strings, then the result of the
numeric comparison is returned.

This is an overloaded operation.  If the arguments are not both
strings, then the query is passed through to @code{scm_num_eq_p()}.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM *~*
@subsection @file{string-has-eqv-match?} - caseless regex contains
@findex string-has-eqv-match?
@findex *~*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 470.
@end ignore
Usage:  (*~* text match)
@*
string-has-eqv-match?:  Test to see if a string contains a pattern.
Case is not significant.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM *~~*
@subsection @file{string-has-match?} - contained regex match
@findex string-has-match?
@findex *~~*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 457.
@end ignore
Usage:  (*~~* text match)
@*
string-has-match?:  Test to see if a string contains a pattern.
Case is significant.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM ~~
@subsection @file{string-match?} - regex match
@findex string-match?
@findex ~~

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 725.
@end ignore
Usage:  (~~ text match)
@*
string-match?:  Test to see if a string fully matches a pattern.
Case is significant.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM ~*
@subsection @file{string-start-eqv-match?} - caseless regex start
@findex string-start-eqv-match?
@findex ~*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 645.
@end ignore
Usage:  (~* text match)
@*
string-start-eqv-match?:  Test to see if a string starts with a pattern.
Case is not significant.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM ~~*
@subsection @file{string-start-match?} - regex match start
@findex string-start-match?
@findex ~~*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 632.
@end ignore
Usage:  (~~* text match)
@*
string-start-match?:  Test to see if a string starts with a pattern.
Case is significant.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM =*
@subsection @file{string-starts-eqv?} - caseless string start
@findex string-starts-eqv?
@findex =*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 378.
@end ignore
Usage:  (=* text match)
@*
string-starts-eqv?:  Test to see if a string starts with an equivalent string.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM ==*
@subsection @file{string-starts-with?} - string starting
@findex string-starts-with?
@findex ==*

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 227.
@end ignore
Usage:  (==* text match)
@*
string-starts-with?:  Test to see if a string starts with a substring.

Arguments:
@*
text - text to test for pattern
@*
match - pattern/substring to search for

@node SCM string-substitute
@subsection @file{string-substitute} - multiple global replacements
@findex string-substitute

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 1142.
@end ignore
Usage:  (string-substitute source match repl)
@*
@code{match} and  @code{repl} may be either a single string or
a list of strings.  Either way, they must have the same structure
and number of elements.  For example, to replace all less than
and all greater than characters, do something like this:

@example
(string-substitute source
("&"     "<"    ">")
("&amp;" "&lt;" "&gt;"))
@end example

Arguments:
@*
source - string to transform
@*
match - substring or substring list to be replaced
@*
repl - replacement strings or substrings

@node SCM string-table-add
@subsection @file{string-table-add} - Add an entry to a string table
@findex string-table-add

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/schemedef.scm line 225.
@end ignore
Usage:  (string-table-add st-name str-val)
@*
Check for a duplicate string and, if none, then insert a new
string into the string table.  In all cases, returns the
character index of the beginning of the string in the table.

The returned index can be used in expressions like:
@example
string_array + <returned-value>
@end example
@noindent
that will yield the address of the first byte of the inserted
string.  See the @file{strtable.test} AutoGen test for a usage
example.

Arguments:
@*
st-name - the name of the array of characters
@*
str-val - the (possibly) new value to add

@node SCM string-table-add-ref
@subsection @file{string-table-add-ref} - Add an entry to a string table, get reference
@findex string-table-add-ref

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/schemedef.scm line 262.
@end ignore
Usage:  (string-table-add-ref st-name str-val)
@*
Identical to string-table-add, except the value returned
is the string "st-name" '+' and the index returned by
string-table-add.

Arguments:
@*
st-name - the name of the array of characters
@*
str-val - the (possibly) new value to add

@node SCM string-table-new
@subsection @file{string-table-new} - create a string table
@findex string-table-new

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/schemedef.scm line 135.
@end ignore
Usage:  (string-table-new st-name)
@*
This function will create an array of characters.  The companion
functions, (@xref{SCM string-table-add}, and @pxref{SCM
emit-string-table}) will insert text and emit the populated table,
respectively.

With these functions, it should be much easier to construct structures
containing string offsets instead of string pointers.  That can be very
useful when transmitting, storing or sharing data with different address
spaces.

@noindent
Here is a brief example copied from the strtable.test test:

@example
[+ (string-table-new "scribble")
   (out-push-new)
   (define ix 0)
   (define ct 1)  +][+

FOR str IN that was the week that was +][+
  (set! ct (+ ct 1))
  (set! ix (string-table-add "scribble" (get "str")))
+]
    scribble + [+ (. ix) +],[+
ENDFOR  +]
    NULL @};
[+ (out-suspend "main")
   (emit-string-table "scribble")
   (ag-fprintf 0 "\nchar const *ap[%d] = @{" ct)
   (out-resume "main")
   (out-pop #t) +]
@end example

@noindent
Some explanation:

@noindent
I added the @code{(out-push-new)} because the string table text is
diverted into an output stream named, ``scribble'' and I want to have
the string table emitted before the string table references.  The string
table references are also emitted inside the @code{FOR} loop.  So, when
the loop is done, the current output is suspended under the
name, ``main'' and the ``scribble'' table is then emitted into the
primary output.  (@code{emit-string-table} inserts its output directly
into the current output stream.  It does not need to be the last
function in an AutoGen macro block.)  Next I @code{ag-fprintf} the
array-of-pointer declaration directly into the current output.
Finally I restore the ``main'' output stream and @code{(out-pop #t)}-it
into the main output stream.

Here is the result.  Note that duplicate strings are not repeated
in the string table:

@example
static char const scribble[18] =
    "that\0" "was\0"  "the\0"  "week\0";

char const *ap[7] = @{
    scribble + 0,
    scribble + 5,
    scribble + 9,
    scribble + 13,
    scribble + 0,
    scribble + 5,
    NULL @};
@end example

These functions use the global name space @code{stt-*} in addition to
the function names.

Arguments:
@*
st-name - the name of the array of characters

@node SCM string-table-size
@subsection @file{string-table-size} - print the current size of a string table
@findex string-table-size

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/schemedef.scm line 309.
@end ignore
Usage:  (string-table-size st-name)
@*
Returns the current byte count of the string table.

Arguments:
@*
st-name - the name of the array of characters

@node SCM string->c-name!
@subsection @file{string->c-name!} - map non-name chars to underscore
@findex string->c-name!

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 285.
@end ignore
Usage:  (string->c-name! str)
@*
Change all the graphic characters that are invalid in a C name token
into underscores.  Whitespace characters are ignored.  Any other
character type (i.e. non-graphic and non-white) will cause a failure.

Arguments:
@*
str - input/output string

@node SCM string-tr
@subsection @file{string-tr} - convert characters with new result
@findex string-tr

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 1121.
@end ignore
Usage:  (string-tr source match translation)
@*
This is identical to @code{string-tr!}, except that it does not
over-write the previous value.

Arguments:
@*
source - string to transform
@*
match - characters to be converted
@*
translation - conversion list

@node SCM string-tr!
@subsection @file{string-tr!} - convert characters
@findex string-tr!

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 1049.
@end ignore
Usage:  (string-tr! source match translation)
@*
This is the same as the @code{tr(1)} program, except the
string to transform is the first argument.  The second and
third arguments are used to construct mapping arrays for the
transformation of the first argument.

It is too bad this little program has so many different
and incompatible implementations!

Arguments:
@*
source - string to transform
@*
match - characters to be converted
@*
translation - conversion list

@node SCM string-upcase
@subsection @file{string-upcase} - upper case a new string
@findex string-upcase

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 360.
@end ignore
Usage:  (string-upcase str)
@*
Create a new SCM string containing the same text as the original,
only all the lower case letters are changed to upper case.

Arguments:
@*
str - input string

@node SCM string-upcase!
@subsection @file{string-upcase!} - make a string be upper case
@findex string-upcase!

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 329.
@end ignore
Usage:  (string-upcase! str)
@*
Change to upper case all the characters in an SCM string.

Arguments:
@*
str - input/output string

@node SCM sub-shell-str
@subsection @file{sub-shell-str} - back quoted (sub-)shell string
@findex sub-shell-str

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 935.
@end ignore
Usage:  (sub-shell-str string)
@*
This function is substantially identical to @code{shell-str}, except
that the quoting character is @code{`} and the "leave the escape alone"
character is @code{"}.

Arguments:
@*
string - string to transform

@node SCM sum
@subsection @file{sum} - sum of values in list
@findex sum

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expGuile.c line 242.
@end ignore
Usage:  (sum list ...)
@*
Compute the sum of the list of expressions.

Arguments:
@*
list - list of values.  Strings are converted to numbers

@node SCM time-string->number
@subsection @file{time-string->number} - duration string to seconds
@findex time-string->number

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expString.c line 1193.
@end ignore
Usage:  (time-string->number time_spec)
@*
Convert the argument string to a time period in seconds.
The string may use multiple parts consisting of days, hours
minutes and seconds.  These are indicated with a suffix of
@code{d}, @code{h}, @code{m} and @code{s} respectively.
Hours, minutes and seconds may also be represented with
@code{HH:MM:SS} or, without hours, as @code{MM:SS}.

Arguments:
@*
time_spec - string to parse

@node SCM version-compare
@subsection @file{version-compare} - compare two version numbers
@findex version-compare

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/expState.c line 222.
@end ignore
Usage:  (version-compare op v1 v2)
@*
Converts v1 and v2 strings into 64 bit values and returns the
result of running 'op' on those values.  It assumes that the version
is a 1 to 4 part dot-separated series of numbers.  Suffixes like,
"5pre4" or "5-pre4" will be interpreted as two numbers.  The first
number ("5" in this case) will be decremented and the number after
the "pre" will be added to 0xC000.  (Unless your platform is unable
to support 64 bit integer arithmetic.  Then it will be added to 0xC0.)
Consequently, these yield true:
@example
(version-compare > "5.8.5"       "5.8.5-pre4")
(version-compare > "5.8.5-pre10" "5.8.5-pre4")
@end example

Arguments:
@*
op - comparison operator
@*
v1 - first version
@*
v2 - compared-to version

@menu
* AGMacro syntax::   AutoGen Macro Syntax
* CASE::             CASE - Select one of several template blocks
* COMMENT::          COMMENT - A block of comment to be ignored
* DEBUG::            DEBUG - Print debug message to trace output
* DEFINE::           DEFINE - Define a user AutoGen macro
* ELIF::             ELIF - Alternate Conditional Template Block
* ELSE::             ELSE - Alternate Template Block
* ENDDEF::           ENDDEF - Ends a macro definition.
* ENDFOR::           ENDFOR - Terminates the @code{FOR} function template block
* ENDIF::            ENDIF - Terminate the @code{IF} Template Block
* ENDWHILE::         ENDWHILE - Terminate the @code{WHILE} Template Block
* ESAC::             ESAC - Terminate the @code{CASE} Template Block
* EXPR::             EXPR - Evaluate and emit an Expression
* FOR::              FOR - Emit a template block multiple times
* IF::               IF - Conditionally Emit a Template Block
* INCLUDE::          INCLUDE - Read in and emit a template block
* INVOKE::           INVOKE - Invoke a User Defined Macro
* SELECT::           SELECT - Selection block for CASE function
* UNKNOWN::          UNKNOWN - Either a user macro or a value name.
* WHILE::            WHILE - Conditionally loop over a Template Block
@end menu
@node AGMacro syntax
@subsection AutoGen Macro Syntax
@cindex macro syntax

The general syntax is:

@example
[ @{ <native-macro-name> | <user-defined-name> @} ] [ <arg> ... ]
@end example

@noindent
The syntax for @code{<arg>} depends on the particular macro,
but is generally a full expression (@pxref{expression syntax}).
Here are the exceptions to that general rule:

@enumerate
@item
@code{INVOKE} macros, implicit or explicit, must be followed by
a list of name/string value pairs.  The string values are
@i{simple expressions}, as described above.

That is, the @code{INVOKE} syntax is one of these two:
@example
<user-macro-name> [ <name> [ = <expression> ] ... ]

INVOKE <name-expression> [ <name> [ = <expression> ] ... ]
@end example

@item
AutoGen FOR macros must be in one of three forms:

@example
FOR <name> [ <separator-string> ]

FOR <name> (...Scheme expression list)

FOR <name> IN <string-entry> [ ... ]
@end example
@noindent
where:
@table @samp
@item <name>
must be a simple name.
@item <separator-string>
is inserted between copies of the enclosed block.  Do not try to use ``IN''
as your separator string.  It won't work.
@item <string-entry>
is an entry in a list of strings.  ``@code{<name>}'' is assigned
each value from the ``@code{IN}'' list before expanding the @code{FOR} block.
@item (...Scheme expression list)
is expected to contain one or more of the @code{for-from},
@code{for-to}, @code{for-by}, and @code{for-sep} functions.
(@xref{FOR}, and @ref{AutoGen Functions})
@end table

The first two forms iterate over the @code{FOR} block if @code{<name>}
is found in the AutoGen values.  The last form will create the AutoGen
value named @code{<name>}.

@item
AutoGen @code{DEFINE} macros must be followed by a simple name.
Anything after that is ignored.  Consequently, that ``comment space''
may be used to document any named values the macro expects to have
set up as arguments.  @xref{DEFINE}.

@item
The AutoGen @code{COMMENT}, @code{ELSE}, @code{ESAC} and the @code{END*}
macros take no arguments and ignore everything after the macro name
(e.g. see @ref{COMMENT})
@end enumerate

@node CASE
@subsection CASE - Select one of several template blocks

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 857.
@end ignore
@findex CASE

The arguments are evaluated and converted to a string, if necessary.  A
simple name will be interpreted as an AutoGen value name and its value will
be used by the @code{SELECT} macros (see the example below and the
expression evaluation function, @pxref{EXPR}).  The scope of the macro is
up to the matching @code{ESAC} macro.  Within the scope of a @code{CASE},
this string is matched against case selection macros.  There are sixteen
match macros that are derived from four different ways matches may be
performed, plus an "always true", "true if the AutoGen value was found",
and "true if no AutoGen value was found" matches.  The codes for the
nineteen match macros are formed as follows:

@enumerate
@item
Must the match start matching from the beginning of the string?
If not, then the match macro code starts with an asterisk (@code{*}).
@item
Must the match finish matching at the end of the string?
If not, then the match macro code ends with an asterisk (@code{*}).
@item
Is the match a pattern match or a string comparison?
If a comparison, use an equal sign (@code{=}).
If a pattern match, use a tilde (@code{~}).
@item
Is the match case sensitive?
If alphabetic case is important, double the tilde or equal sign.
@item
Do you need a default match when none of the others match?
Use a single asterisk (@code{*}).
@item
Do you need to distinguish between an empty string value and a value
that was not found?  Use the non-existence test (@code{!E}) before
testing a full match against an empty string (@code{== ''}).
There is also an existence test (@code{+E}), more for symmetry than
for practical use.
@end enumerate

@noindent
For example:

@example
[+ CASE <full-expression> +]
[+ ~~*  "[Tt]est" +]reg exp must match at start, not at end
[+ ==   "TeSt"    +]a full-string, case sensitive compare
[+ =    "TEST"    +]a full-string, case insensitive compare
[+ !E             +]not exists - matches if no AutoGen value found
[+ ==   ""        +]expression yielded a zero-length string
[+ +E             +]exists - matches if there is any value result
[+ *              +]always match - no testing
[+ ESAC +]
@end example

@code{<full-expression>} (@pxref{expression syntax}) may be any expression,
including the use of apply-codes and value-names.  If the expression yields
a number, it is converted to a decimal string.

These case selection codes have also been implemented as
Scheme expression functions using the same codes.  They are documented
in this texi doc as ``string-*?'' predicates (@pxref{Common Functions}).

@node COMMENT
@subsection COMMENT - A block of comment to be ignored

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/functions.c line 215.
@end ignore
@findex COMMENT

This function can be specified by the user, but there will
never be a situation where it will be invoked at emit time.
The macro is actually removed from the internal representation.

If the native macro name code is @code{#}, then the
entire macro function is treated as a comment and ignored.

@example
[+ # say what you want, but no '+' before any ']' chars +]
@end example

@node DEBUG
@subsection DEBUG - Print debug message to trace output

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcDef.c line 382.
@end ignore
@findex DEBUG

If the tracing level is at "debug-message" or above
(@pxref{autogen trace}), this macro prints a debug message to trace
output.  This message is not evaluated.  This macro can also be used to
set useful debugger breakpoints.  By inserting [+DEBUG n+] into your
template, you can set a debugger breakpoint on the #n case element
below (in the AutoGen source) and step through the processing of
interesting parts of your template.

To be useful, you have to have access to the source tree where autogen
was built and the template being processed.  The definitions are also
helpful, but not crucial.  Please contact the author if you think you
might actually want to use this.

@node DEFINE
@subsection DEFINE - Define a user AutoGen macro

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcDef.c line 527.
@end ignore
@findex DEFINE
@cindex define macro

This function will define a new macro.  You must provide a name for the
macro.  You do not specify any arguments, though the invocation may
specify a set of name/value pairs that are to be active during the
processing of the macro.

@example
[+ define foo +]
... macro body with macro functions ...
[+ enddef +]
... [+ foo bar='raw text' baz=<<text expression>> +]
@end example

Once the macro has been defined, this new macro can be invoked by
specifying the macro name as the first token after the start macro marker.
Alternatively, you may make the invocation explicitly invoke a defined
macro by specifying @code{INVOKE} (@pxref{INVOKE}) in the macro
invocation.  If you do that, the macro name can be computed with an
expression that gets evaluated every time the INVOKE macro is encountered.

Any remaining text in the macro invocation will be used to create new
name/value pairs that only persist for the duration of the processing of
the macro.  The expressions are evaluated the same way basic
expressions are evaluated.  @xref{expression syntax}.

The resulting definitions are handled much like regular
definitions, except:

@enumerate
@item
The values may not be compound.  That is, they may not contain
nested name/value pairs.
@item
The bindings go away when the macro is complete.
@item
The name/value pairs are separated by whitespace instead of
semi-colons.
@item
Sequences of strings are not concatenated.
@end enumerate

@quotation
@strong{NB:} The macro is extracted from the template as the template is
scanned.  You cannot conditionally define a macro by enclosing it in an
@code{IF}/@code{ENDIF} (@pxref{IF}) macro pair.  If you need to dynamically
select the format of a @code{DEFINE}d macro, then put the flavors into
separate template files that simply define macros.  @code{INCLUDE}
(@pxref{INCLUDE}) the appropriate template when you have computed which
you need.
@end quotation

Due to this, it is acceptable and even a good idea to place all the
@code{DEFINE} macros at the end of the template.  That puts the main
body of the template at the beginning of the file.

@node ELIF
@subsection ELIF - Alternate Conditional Template Block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcIf.c line 261.
@end ignore
@findex ELIF

This macro must only appear after an @code{IF} function, and
before any associated @code{ELSE} or @code{ENDIF} functions.
It denotes the start of an alternate template block for the
@code{IF} function.  Its expression argument is evaluated as are
the arguments to @code{IF}.  For a complete description @xref{IF}.

@node ELSE
@subsection ELSE - Alternate Template Block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcIf.c line 289.
@end ignore
@findex ELSE

This macro must only appear after an @code{IF} function,
and before the associated @code{ENDIF} function.
It denotes the start of an alternate template block for
the @code{IF} function.  For a complete description @xref{IF}.

@node ENDDEF
@subsection ENDDEF - Ends a macro definition.

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcDef.c line 591.
@end ignore
@findex ENDDEF

This macro ends the @code{DEFINE} function template block.
For a complete description @xref{DEFINE}.

@node ENDFOR
@subsection ENDFOR - Terminates the @code{FOR} function template block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 673.
@end ignore
@findex ENDFOR

This macro ends the @code{FOR} function template block.
For a complete description @xref{FOR}.

@node ENDIF
@subsection ENDIF - Terminate the @code{IF} Template Block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcIf.c line 136.
@end ignore
@findex ENDIF

This macro ends the @code{IF} function template block.
For a complete description @xref{IF}.

@node ENDWHILE
@subsection ENDWHILE - Terminate the @code{WHILE} Template Block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcIf.c line 220.
@end ignore
@findex ENDWHILE

This macro ends the @code{WHILE} function template block.
For a complete description @xref{WHILE}.

@node ESAC
@subsection ESAC - Terminate the @code{CASE} Template Block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 924.
@end ignore
@findex ESAC

This macro ends the @code{CASE} function template block.
For a complete description, @xref{CASE}.

@node EXPR
@subsection EXPR - Evaluate and emit an Expression

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcEval.c line 431.
@end ignore
@findex EXPR

This macro does not have a name to cause it to be invoked
explicitly, though if a macro starts with one of the apply codes
or one of the simple expression markers, then an expression
macro is inferred.  The result of the expression evaluation
(@pxref{expression syntax}) is written to the current output.

@node FOR
@subsection FOR - Emit a template block multiple times

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcFor.c line 594.
@end ignore
@findex FOR
@cindex looping, for
@cindex for loop

This macro has a slight variation on the standard syntax:
@example
FOR <value-name> [ <separator-string> ]

FOR <value-name> (...Scheme expression list)

FOR <value-name> IN "string" [ ... ]
@end example

Other than for the last form, the first macro argument must be the name of
an AutoGen value.  If there is no value associated with the name, the
@code{FOR} template block is skipped entirely.  The scope of the @code{FOR}
macro extends to the corresponding @code{ENDFOR} macro.  The last form will
create an array of string values named @code{<value-name>} that only exists
within the context of this @code{FOR} loop.  With this form, in order to
use a @code{separator-string}, you must code it into the end of the
template block using the @code{(last-for?)} predicate function
(@pxref{SCM last-for?}).

If there are any arguments after the @code{value-name}, the initial
characters are used to determine the form.  If the first character is
either a semi-colon (@code{;}) or an opening parenthesis (@code{(}), then
it is presumed to be a Scheme expression containing the FOR macro specific
functions @code{for-from}, @code{for-by}, @code{for-to}, and/or
@code{for-sep}.  @xref{AutoGen Functions}.  If it consists of an '@code{i}'
an '@code{n}' and separated by white space from more text, then the
@code{FOR x IN} form is processed.  Otherwise, the remaining text is
presumed to be a string for inserting between each iteration of the loop.
This string will be emitted one time less than the number of iterations of
the loop.  That is, it is emitted after each loop, excepting for the last
iteration.

If the from/by/to functions are invoked, they will specify which copies of
the named value are to be processed.  If there is no copy of the named
value associated with a particular index, the @code{FOR} template block
will be instantiated anyway.  The template must use methods for detecting
missing definitions and emitting default text.  In this fashion, you can
insert entries from a sparse or non-zero based array into a dense, zero
based array.

@strong{NB:} the @code{for-from}, @code{for-to}, @code{for-by} and
@code{for-sep} functions are disabled outside of the context of the
@code{FOR} macro.  Likewise, the @code{first-for}, @code{last-for}
and @code{for-index} functions are disabled outside of the range
of a @code{FOR} block.

@strong{Also:} the @code{<value-name>} must be a single level name,
not a compound name (@pxref{naming values}).

@example
[+FOR var (for-from 0) (for-to <number>) (for-sep ",") +]
... text with @code{var}ious substitutions ...[+
ENDFOR var+]
@end example

@noindent
this will repeat the @code{... text with @code{var}ious
substitutions ...} <number>+1 times.  Each repetition,
except for the last, will have a comma @code{,} after it.

@example
[+FOR var ",\n" +]
... text with @code{var}ious substitutions ...[+
ENDFOR var +]
@end example

@noindent
This will do the same thing, but only for the index
values of @code{var} that have actually been defined.

@node IF
@subsection IF - Conditionally Emit a Template Block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcIf.c line 100.
@end ignore
@findex IF
@cindex conditional emit
@cindex if test

Conditional block.  Its arguments are evaluated (@pxref{EXPR}) and
if the result is non-zero or a string with one or more bytes,
then the condition is true and the text from that point
until a matched @code{ELIF}, @code{ELSE} or @code{ENDIF} is emitted.
@code{ELIF} introduces a conditional alternative if the @code{IF}
clause evaluated FALSE and @code{ELSE} introduces an unconditional
alternative.

@example
[+IF <full-expression> +]
emit things that are for the true condition[+

ELIF <full-expression-2> +]
emit things that are true maybe[+

ELSE "This may be a comment" +]
emit this if all but else fails[+

ENDIF "This may *also* be a comment" +]
@end example

@noindent
@code{<full-expression>} may be any expression described in the
@code{EXPR} expression function, including the use of apply-codes
and value-names.  If the expression yields an empty string, it
is interpreted as @i{false}.

@node INCLUDE
@subsection INCLUDE - Read in and emit a template block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/functions.c line 29.
@end ignore
@findex INCLUDE

The entire contents of the named file is inserted at this point.
The contents of the file are processed for macro expansion.  The
arguments are eval-ed, so you may compute the name of the file to
be included.  The included file must not contain any incomplete
function blocks.  Function blocks are template text beginning with
any of the macro functions @samp{CASE}, @samp{DEFINE}, @samp{FOR},
@samp{IF} and @samp{WHILE}; extending through their respective
terminating macro functions.

@node INVOKE
@subsection INVOKE - Invoke a User Defined Macro

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcDef.c line 665.
@end ignore
@findex INVOKE

User defined macros may be invoked explicitly or implicitly.
If you invoke one implicitly, the macro must begin with the
name of the defined macro.  Consequently, this may @strong{not}
be a computed value.  If you explicitly invoke a user defined macro,
the macro begins with the macro name @code{INVOKE} followed by
a @i{basic expression} that must yield a known user defined macro.
A macro name _must_ be found, or AutoGen will issue a diagnostic
and exit.

Arguments are passed to the invoked macro by name.
The text following the macro name must consist of a series of
names each of which is followed by an equal sign (@code{=}) and
a @i{basic expression} that yields a string.

The string values may contain template macros that are parsed
the first time the macro is processed and evaluated again every
time the macro is evaluated.

@node SELECT
@subsection SELECT - Selection block for CASE function

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcCase.c line 1146.
@end ignore
@findex SELECT

This macro selects a block of text by matching an expression
against the sample text expression evaluated in the @code{CASE}
macro.  @xref{CASE}.

You do not specify a @code{SELECT} macro with the word ``select''.
Instead, you must use one of the 19 match operators described in
the @code{CASE} macro description.

@node UNKNOWN
@subsection UNKNOWN - Either a user macro or a value name.

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/functions.c line 111.
@end ignore
@findex UNKNOWN

The macro text has started with a name not known to AutoGen.  If, at run
time, it turns out to be the name of a defined macro, then that macro is
invoked.  If it is not, then it is a conditional expression that is
evaluated only if the name is defined at the time the macro is invoked.

You may not specify @code{UNKNOWN} explicitly.

@node WHILE
@subsection WHILE - Conditionally loop over a Template Block

@ignore
Generated from auto_gen.tpl line 522.
Extracted from /usr/src/autogen/_build/agen5/funcIf.c line 193.
@end ignore
@findex WHILE
@cindex conditional emit
@cindex while test

Conditionally repeated block.  Its arguments are evaluated (@pxref{EXPR})
and as long as the result is non-zero or a string with one or more bytes,
then the condition is true and the text from that point
until a matched @code{ENDWHILE} is emitted.

@example
[+WHILE <full-expression> +]
emit things that are for the true condition[+

ENDWHILE +]
@end example

@noindent
@code{<full-expression>} may be any expression described in the
@code{EXPR} expression function, including the use of apply-codes
and value-names.  If the expression yields an empty string, it
is interpreted as @i{false}.

@ignore

Invocation section from invoke-autogen.texi

@end ignore
@page

@include invoke-autogen.texi

@page
@node AutoOpts
@chapter Automated Option Processing
@cindex autoopts

AutoOpts 33.2 is bundled with AutoGen.  It is a tool that virtually eliminates the
hassle of processing options and keeping man pages, info docs and usage text
up to date.  This package allows you to specify several program attributes, up
to a hundred option types and many option attributes.  From this, it then
produces all the code necessary to parse and handle the command line and
configuration file options, and the documentation that should go with your
program as well.
@noindent
First, specify your program attributes and its options to AutoOpts,
as with the following example.

@example
AutoGen Definitions options;
prog-name     = check;
prog-title    = "Checkout Automated Options";
long-opts;

main = @{ main-type = shell-process; @};

flag = @{
    name      = check-dirs;
    value     = L;        /* flag style option character */
    arg-type  = string;   /* option argument indication  */
    max       = NOLIMIT;  /* occurrence limit (none)     */
    stack-arg;            /* save opt args in a stack    */
    descrip   = "Checkout directory list";
@};

flag = @{
    name      = show_defs;
    descrip   = "Show the definition tree";
    disable   = dont;     /* mark as enable/disable type */
                          /* option.  Disable as `dont-' */
@};
@end example

@noindent
Then perform the following steps:

@enumerate
@item
@code{cflags="-DTEST_CHECK_OPTS `autoopts-config cflags`"}
@item
@code{ldflags="`autoopts-config ldflags`"}
@item
@code{autogen checkopt.def}
@item
@code{cc -o check -g $@{cflags@} checkopt.c $@{ldflags@}}
@item
@code{./check --help}
@end enumerate

@noindent
Running those commands yields:

@example
