Next: Parameter Definitions, Up: Genparse File Syntax [Contents][Index]
The following definitions are allowed on top of the parameter definitions. All of them are optional. They may appear in any order.
#include "file.h"
or #include <file.h>
.
Ignored in languages other than C and C++. Only 1 include statement per
line.
#mandatory x
. Use multiple #mandatory
statements
in order to specify multiple mandatory parameters.
Only 1 #mandatory
statement per line. Note that Genparse
does not check for mandatory parameters, they are only printed
in the usage ()
function with the __MANDATORIES__
directive (See __MANDATORIES__.). Deprecated: add mandatory
parameters in the #usage section instead.
EXIT_FAILURE
. Example: #exit_value -1
or
#exit_value MY_FAILURE
.
#break_lines
directive is
specified then lines will be printed exactly as given in the genparse file.
Note that genparse doesn’t know the width of macros included from other
files, so automatic line breaking will probably not work properly if for
example __STRING__
macros (See __STRING__.) are used. Lines
can still be broken manually using the __NL__
macro (See __NL__.)
in places where Genparse doesn’t break lines as expected.
#no_struct
is specified then no struct
will be defined which will be filled with the command line parameters in
the generated parser. This may be useful if you want to add your own code
with __CODE__
statements instead (See __CODE__.) Only supported
for C output.
#export_long_options
is defined
then a function get_long_options ()
is added which exports the
longoptions array used by getopt_long ()
. This directive is only available
for C output, for other languages it is ignored.
my_callback ()
. Only 1 global callback function is allowed.
Next: Parameter Definitions, Up: Genparse File Syntax [Contents][Index]