GRASS GIS 7 Programmer's Manual  7.0.4(2016)-r00000
manage/list.c
Go to the documentation of this file.
1 
14 #include <grass/gis.h>
15 
16 #include "manage_local_proto.h"
17 
26 const struct list *M_get_list(int n)
27 {
28  if (n >= nlist)
29  return NULL;
30 
31  return &(list[n]);
32 }
33 
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 }
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower)
Definition: strings.c:46
int nlist
Definition: read_list.c:23
const struct list * M_get_list(int n)
Get list structure.
Definition: manage/list.c:26
#define NULL
Definition: ccmath.h:32
struct list * list
Definition: read_list.c:24
int M_get_element(const char *data_type)
Find element type by name.
Definition: manage/list.c:42