GRASS GIS 8 Programmer's Manual
8.5.0dev(2025)-565e82de51
Main Page
Related Pages
Data Structures
Data Structures
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
Enumerations
a
c
d
e
h
i
j
l
m
n
o
p
r
s
t
v
y
Enumerator
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
add_elem.c
Go to the documentation of this file.
1
/*!
2
\file lib/manage/add_elem.c
3
4
\brief Manage Library - Add element to the list
5
6
(C) 2001-2011 by the GRASS Development Team
7
8
This program is free software under the GNU General Public License
9
(>=v2). Read the file COPYING that comes with GRASS for details.
10
11
\author Original author CERL
12
*/
13
14
#include <
grass/gis.h
>
15
16
#include "manage_local_proto.h"
17
18
/*!
19
\brief Add element to the list
20
21
\param elem element name
22
\param desc description of the element
23
*/
24
void
M__add_element
(
const
char
*elem,
const
char
*desc)
25
{
26
int
n;
27
int
nelem;
28
29
if
(*desc == 0)
30
desc = elem;
31
32
n =
nlist
- 1;
33
nelem =
list
[n].
nelem
++;
34
list
[n].
element
=
35
G_realloc
(
list
[n].
element
, (nelem + 1) *
sizeof
(
const
char
*));
36
list
[n].
element
[nelem] =
G_store
(elem);
37
list
[n].
desc
=
G_realloc
(
list
[n].desc, (nelem + 1) *
sizeof
(
const
char
*));
38
list
[n].
desc
[nelem] =
G_store
(desc);
39
}
M__add_element
void M__add_element(const char *elem, const char *desc)
Add element to the list.
Definition:
add_elem.c:24
G_realloc
#define G_realloc(p, n)
Definition:
defs/gis.h:96
G_store
char * G_store(const char *)
Copy string to allocated memory.
Definition:
strings.c:87
gis.h
nlist
int nlist
Definition:
read_list.c:23
element
Definition:
lidar.h:85
list
Definition:
manage.h:4
list::desc
const char ** desc
Definition:
manage.h:7
list::nelem
int nelem
Definition:
manage.h:9
list::element
const char ** element
Definition:
manage.h:5
lib
manage
add_elem.c
Generated on Thu Mar 20 2025 07:33:21 for GRASS GIS 8 Programmer's Manual by
1.9.1