[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The pseudo macro is used to tell AutoGen how to process a template. It tells autogen:
It is generally a good idea to use some sort of opening
bracket in the starting macro and closing bracket in the ending
macro (e.g. {
, (
, [
, or even <
in the starting macro). It helps both visually and with editors
capable of finding a balancing parenthesis.
The next several components may be intermingled:
(suffix)
scheme function (see section `suffix' - get the current suffix).
The suffix specification consists of a sequence of POSIX compliant file name
characters and, optionally, an equal sign and a file name formatting
specification. That specification may be either an ordinary sequence
of file name characters with zero, one or two "%s" formatting sequences
in it, or else it may be a Scheme expression that, when evaluated,
produces such a string. The two string arguments allowed for that string are
the base name of the definition file, and the current suffix (that being
the text to the left of the equal sign). (Note: "POSIX compliant file
name characters" consist of alphanumerics plus the period (.
),
hyphen (-
) and underscore (_
) characters.)
If the suffix begins with one of these three latter characters and a formatting string is not specified, then that character is presumed to be the suffix separator. Otherwise, without a specified format string, a single period will separate the suffix from the base name in constructing the output file name.
#
]),
and edit mode comments (text between pairs of -*-
strings).
(setenv "SHELL" "/bin/sh") |
This is extremely useful to ensure that the shell used is the one the template was written to use. By default, AutoGen determines the shell to use by user preferences. Sometimes, that can be the "csh", though.
The scheme expression can also be used to save a pre-existing output file for later text extraction (see section `extract' - extract text from another file).
(shellf "mv -f %1$s.c %1$s.sav" (base-name)) |
After these must come the end macro marker:
The ending macro marker has a few constraints on its content. Some of them are just advisory, though. There is no special check for advisory restrictions.
-
,
underscore _
or period .
), the backslash (\
) or
open parenthesis ((
). These are used to identify a suffix
specification, indicate Scheme code and trim white space.
\
) before the end macro mark, then
any white space characters after the mark and through the newline character
are trimmed.
#
).
It might be seen as a comment within the pseudo macro.
As an example, assume we want to use [+
and +]
as the start
and end macro markers, and we wish to produce a `.c' and a `.h'
file, then the pseudo macro might look something like this:
[+ AutoGen5 template -*- Mode: emacs-mode-of-choice -*- h=chk-%s.h c # make sure we don't use csh: (setenv "SHELL" "/bin/sh") +] |
The template proper starts after the pseudo-macro. The starting character is either the first non-whitespace character or the first character after the newline that follows the end macro marker.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Bruce Korb on September, 30 2006 using texi2html 1.76.