GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
|
GIS Library - Argument parsing functions (dependencies between options) More...
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "parser_local_proto.h"
Go to the source code of this file.
Functions | |
void | G_option_rule (int type, int nopts, void **opts) |
Set generic option rule. | |
void | G_option_exclusive (void *first,...) |
Sets the options to be mutually exclusive. | |
void | G_option_required (void *first,...) |
Sets the options to be required. | |
void | G_option_requires (void *first,...) |
Define a list of options from which at least one option is required if first option is present. | |
void | G_option_requires_all (void *first,...) |
Define additionally required options for an option. | |
void | G_option_excludes (void *first,...) |
Exclude selected options. | |
void | G_option_collective (void *first,...) |
Sets the options to be collective. | |
void | G__check_option_rules (void) |
Check for option rules (internal use only) | |
void | G__describe_option_rules (void) |
Describe option rules (stderr) | |
int | G__has_required_rule (void) |
Checks if there is any rule RULE_REQUIRED (internal use only). | |
void | G__describe_option_rules_xml (FILE *fp) |
Describe option rules in XML format (internal use only) | |
GIS Library - Argument parsing functions (dependencies between options)
(C) 2014-2015 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file parser_dependencies.c.
void G__check_option_rules | ( | void | ) |
Check for option rules (internal use only)
Definition at line 391 of file parser_dependencies.c.
References G_fatal_error().
Referenced by G_parser().
void G__describe_option_rules | ( | void | ) |
Describe option rules (stderr)
Definition at line 426 of file parser_dependencies.c.
References G_fatal_error().
void G__describe_option_rules_xml | ( | FILE * | fp | ) |
Describe option rules in XML format (internal use only)
fp | file where to print XML info |
Definition at line 490 of file parser_dependencies.c.
References G_fatal_error().
Referenced by G__usage_xml().
int G__has_required_rule | ( | void | ) |
Checks if there is any rule RULE_REQUIRED (internal use only).
Definition at line 469 of file parser_dependencies.c.
Referenced by G_parser().
void G_option_collective | ( | void * | first, |
... | |||
) |
Sets the options to be collective.
If any option is present, all the other options must also be present all or nothing from a set.
first | first given option |
Definition at line 368 of file parser_dependencies.c.
void G_option_excludes | ( | void * | first, |
... | |||
) |
Exclude selected options.
If the first option is present, none of the other options may also (should?) be present.
first | first given option |
Definition at line 339 of file parser_dependencies.c.
void G_option_exclusive | ( | void * | first, |
... | |||
) |
Sets the options to be mutually exclusive.
When running the module, at most one option from a set can be provided.
first | first given option |
Definition at line 212 of file parser_dependencies.c.
void G_option_required | ( | void * | first, |
... | |||
) |
Sets the options to be required.
At least one option from a set must be given.
first | first given option |
Definition at line 238 of file parser_dependencies.c.
void G_option_requires | ( | void * | first, |
... | |||
) |
Define a list of options from which at least one option is required if first option is present.
If the first option is present, at least one of the other options must also be present.
If you want all options to be provided use G_option_requires_all() function. If you want more than one option to be present but not all, call this function multiple times.
first | first given option |
Definition at line 272 of file parser_dependencies.c.
void G_option_requires_all | ( | void * | first, |
... | |||
) |
Define additionally required options for an option.
If the first option is present, all the other options must also be present.
If it is enough if only one option from a set is present, use G_option_requires() function.
first | first given option |
Definition at line 310 of file parser_dependencies.c.
void G_option_rule | ( | int | type, |
int | nopts, | ||
void ** | opts | ||
) |
Set generic option rule.
Supported rule types:
type | rule type |
nopts | number of options in the array |
opts | array of options |
Definition at line 77 of file parser_dependencies.c.