8.5 Invoking getdefs
If no input
argument is provided or is set to simply "-", and if
stdin
is not a tty
, then the list of input files will be
read from stdin
.
This program extracts AutoGen definitions from a list of source files.
Definitions are delimited by `/*=<entry-type> <entry-name>\n' and `=*/\n'.
From that, this program creates a definition of the following form:
| #line nnn "source-file-name"
entry_type = {
name = entry_name;
...
};
|
The ellipsis "..." is filled in by text found between the two delimiters,
using the following rules:
-
Each entry is located by the pattern "\n[^*\n]*\\*[ \t]*([a-z][a-z0-9_]*):".
Fundamentally, it finds a line that, after the first asterisk on the line,
contains whitespace then a name and is immediately followed by a colon.
The name becomes the name of the attribute and what follows, up to the
next attribute, is its value.
-
If the first character of the value is either a single or double quote,
then you are responsible for quoting the text as it gets inserted into
the output definitions.
-
All the leading text on a line is stripped from the value.
The leading text is everything before the first asterisk,
the asterisk and all the whitespace characters that immediately
follow it. If you want whitespace at the beginnings of the lines
of text, you must do something like this:
| * mumble:
* " this is some\n"
* " indented text."
|
-
If the `<entry-name>' is followed by a comma, the word `ifdef'
(or `ifndef') and a name `if_name', then the above entry will appear as:
| #ifdef if_name
#line nnn "source-file-name"
entry_type = {
name = entry_name;
...
};
#endif
|
-
If you use of the
subblock
option, you can specify a nested
value, See section subblock option. That is, this text:
| * arg: int, this, what-it-is
|
with the `-subblock=arg=type,name,doc' option would yield:
| arg = { type = int; name = this; doc = what-it-is; };
|
This section was generated by AutoGen,
the aginfo template and the option descriptions for the getdefs
program. It documents the getdefs usage text and option meanings.
This software is released under the GNU General Public License.
This document was generated by Bruce Korb on September, 30 2006 using texi2html 1.76.