8.6 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. Each line of text is stripped of anything before the first
asterisk, then leading asterisks, then any leading or trailing white space.
-
If what is left starts with what looks like a name followed by a colon, then
it is interpreted as a name followed by a 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. So, 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 be under
ifdef
control.
| /*=group entry_name, ifdef FOO
* attr: attribute value
=*/
|
Will produce the following:
| #ifdef FOO
#line nnn "source-file-name"
group = {
name = entry_name;
attr = 'attribute value';
};
#endif
|
-
If you use of the
subblock
option, you can specify a nested
value, See getdefs subblock. 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,
using the agtexi-cmd
template and the option descriptions for the getdefs
program.
This software is released under the GNU General Public License, version 3 or later.
This document was generated by Bruce Korb on August 21, 2015 using texi2html 1.82.