GRASS 8 Programmer's Manual
8.5.0(2026)-8d6ceba290
Toggle main menu visibility
Loading...
Searching...
No Matches
manage/list.c
Go to the documentation of this file.
1
/*!
2
\file lib/manage/list.c
3
4
\brief Manage Library - Element info
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 Get list structure
20
21
\param n element id
22
23
\return pointer to list structure
24
\return NULL on error
25
*/
26
const
struct
list
*
M_get_list
(
int
n)
27
{
28
if
(n >=
nlist
)
29
return
NULL
;
30
31
return
&(
list
[n]);
32
}
33
34
/*!
35
\brief Find element type by name
36
37
\param data_type element type
38
39
\return element id
40
\return -1 not found
41
*/
42
int
M_get_element
(
const
char
*data_type)
43
{
44
int
n;
45
46
for
(n = 0; n <
nlist
; n++) {
47
if
(
G_strcasecmp
(
list
[n].alias, data_type) == 0)
48
return
n;
49
}
50
51
return
-1;
52
}
NULL
#define NULL
Definition
ccmath.h:32
M_get_element
int M_get_element(const char *data_type)
Find element type by name.
Definition
manage/list.c:42
M_get_list
const struct list * M_get_list(int n)
Get list structure.
Definition
manage/list.c:26
nlist
int nlist
Definition
read_list.c:23
list
struct list * list
Definition
read_list.c:24
G_strcasecmp
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower).
Definition
strings.c:47
manage
list.c
Generated on
for GRASS 8 Programmer's Manual by
1.17.0