Loading...
Searching...
No Matches
parser_standard_options.c File Reference

GIS Library - Argument parsing functions (standard options). More...

`#include <grass/gis.h>`
`#include <grass/glocale.h>`
`#include "parser_local_proto.h"`
Include dependency graph for parser_standard_options.c:

Go to the source code of this file.

## Functions

struct Option * | G_define_standard_option (int opt)
| Create standardised Option structure.
struct Flag * | G_define_standard_flag (int flag)
| Create standardised Flag structure.

## Detailed Description

GIS Library - Argument parsing functions (standard options).

(C) 2001-2019 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.

Author
  Original author CERL
  Soeren Gebbert added Dec. 2009 WPS process_description document
  Luca Delucchi added Aug 2011 G_OPT_M_DIR

Definition in file parser_standard_options.c.

## Function Documentation

## G_define_standard_flag()

struct Flag * G_define_standard_flag | ( | int | flag | ) |

Create standardised Flag structure.

This function will create a standardised Flag structure defined by parameter flag. A list of valid parameters below. It allocates memory for the Flag structure and returns a pointer to this memory.

If an invalid parameter was specified a empty Flag structure will be returned (not NULL).

- G_FLG_V_TABLE (do not create attribute table)
- G_FLG_V_TOPO (do not build topology)

Parameters

  flag | type of Flag struct to create specified by STD_FLG enum.

Returns
  pointer to an Flag struct

Definition at line 1025 of file parser_standard_options.c.

References G_define_flag().

## G_define_standard_option()

struct Option * G_define_standard_option | ( | int | opt | ) |

Create standardised Option structure.

This function will create a standardised Option structure defined by parameter opt.

Valid parameters are defined by the STD_OPT enum in the file gis.h. A list of valid parameter values sorted to groups is below.

This function allocates memory for the Option structure and returns a pointer to this memory.

If an invalid parameter was specified a empty Option structure will be returned (not NULL).

Values also need to be added to general/g.parser/standard_option.c

List of STD_OPT values sorted by module group
  - database:
  - G_OPT_DB_SQL
  - G_OPT_DB_WHERE
  - G_OPT_DB_TABLE
  - G_OPT_DB_DRIVER
  - G_OPT_DB_DATABASE
  - G_OPT_DB_SCHEMA
  - G_OPT_DB_COLUMN
  - G_OPT_DB_COLUMNS
  - G_OPT_DB_KEYCOLUMN
  - imagery:
  - G_OPT_I_GROUP
  - G_OPT_I_SUBGROUP
  - raster:
  - G_OPT_MEMORYMB
  - G_OPT_R_INPUT
  - G_OPT_R_INPUTS
  - G_OPT_R_OUTPUT
  - G_OPT_R_MAP
  - G_OPT_R_MAPS
  - G_OPT_R_BASE
  - G_OPT_R_COVER
  - G_OPT_R_ELEV
  - G_OPT_R_ELEVS
  - G_OPT_R_TYPE
  - G_OPT_R_INTERP_TYPE
  - G_OPT_R_BASENAME_INPUT
  - G_OPT_R_BASENAME_OUTPUT
  - raster3d:
  - G_OPT_R3_INPUT
  - G_OPT_R3_INPUTS
  - G_OPT_R3_OUTPUT
  - G_OPT_R3_MAP
  - G_OPT_R3_MAPS
  - vector:
  - G_OPT_V_INPUT
  - G_OPT_V_INPUTS
  - G_OPT_V_OUTPUT
  - G_OPT_V_MAP
  - G_OPT_V_MAPS
  - G_OPT_V_TYPE
  - G_OPT_V_FIELD
  - G_OPT_V_FIELD_ALL
  - G_OPT_V_CAT
  - G_OPT_V_CATS
  - G_OPT_V_ID
  - G_OPT_V_IDS
  - files
  - G_OPT_F_INPUT
  - G_OPT_F_BIN_INPUT
  - G_OPT_F_OUTPUT
  - G_OPT_F_SEP
  - G_OPT_F_FORMAT
  - colors
  - G_OPT_C
  - G_OPT_CN
  - G_OPT_C_FORMAT
  - misc
  - G_OPT_M_DIR
  - G_OPT_M_UNITS
  - G_OPT_M_DATATYPE
  - G_OPT_M_MAPSET
  - G_OPT_M_LOCATION
  - G_OPT_M_DBASE
  - G_OPT_M_COORDS
  - G_OPT_M_COLR
  - G_OPT_M_REGION
  - G_OPT_M_NULL_VALUE
  - G_OPT_M_NPROCS
  - G_OPT_M_SEED
  - temporal GIS framework
  - G_OPT_STDS_INPUT
  - G_OPT_STDS_INPUTS
  - G_OPT_STDS_OUTPUT
  - G_OPT_STRDS_INPUT
  - G_OPT_STRDS_INPUTS
  - G_OPT_STRDS_OUTPUT
  - G_OPT_STRDS_OUTPUTS
  - G_OPT_STR3DS_INPUT
  - G_OPT_STR3DS_INPUTS
  - G_OPT_STR3DS_OUTPUT
  - G_OPT_STVDS_INPUT
  - G_OPT_STVDS_INPUTS
  - G_OPT_STVDS_OUTPUT
  - G_OPT_MAP_INPUT
  - G_OPT_MAP_INPUTS
  - G_OPT_STDS_TYPE
  - G_OPT_MAP_TYPE
  - G_OPT_T_SUFFIX
  - G_OPT_T_TYPE
  - G_OPT_T_WHERE

Parameters

  opt | type of Option struct to create specified by STD_OPT enum

Returns
  pointer to an Option struct

Definition at line 143 of file parser_standard_options.c.

References G_asprintf(), G_color_rules_description_type(), G_color_rules_options(), G_define_option(), G_getenv_nofatal(), and G_store().