GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
option.c File Reference

Manage Library - Define option for parser. More...

#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "manage_local_proto.h"
Include dependency graph for option.c:

Go to the source code of this file.

Functions

struct OptionM_define_option (int n, const char *desc, int multiple)
 Define option for parser. More...
 
const char * M_get_options (int do_all)
 Get list of element types separated by comma. More...
 
const char * M_get_option_desc (int do_all)
 Get list of element desc separated by comma. More...
 

Detailed Description

Manage Library - Define option for parser.

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

Definition in file option.c.

Function Documentation

◆ M_define_option()

struct Option* M_define_option ( int  n,
const char *  desc,
int  multiple 
)

Define option for parser.

Parameters
nelement id
Returns
pointer to Option structure
NULL on error

Definition at line 28 of file option.c.

References _, list::alias, Option::description, G_asprintf(), G_define_option(), Option::gisprompt, Option::guisection, Option::key, Option::key_desc, Option::multiple, nlist, NO, NULL, Option::required, Option::type, and TYPE_STRING.

◆ M_get_option_desc()

const char* M_get_option_desc ( int  do_all)

Get list of element desc separated by comma.

String buffer is allocated by G_malloc().

Parameters
do_allTRUE to add "all" to the buffer
Returns
pointer to allocated buffer with desc

Definition at line 106 of file option.c.

References G_malloc, and nlist.

◆ M_get_options()

const char* M_get_options ( int  do_all)

Get list of element types separated by comma.

String buffer is allocated by G_malloc().

Parameters
do_allTRUE to add "all" to the buffer
Returns
pointer to allocated buffer with types

Definition at line 71 of file option.c.

References G_malloc, and nlist.