Loading...
Searching...
No Matches
do_list.c
Go to the documentation of this file.
/*!
\file lib/manage/do_list.c
\brief Manage Library - List elements
(C) 2001-2012 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
*/
#include <grass/gis.h>
#include <grass/glocale.h>
#include "manage_local_proto.h"
/*!
\brief List elements
\param n element index in the array (negative value for all elements)
\param mapset name of mapset ("" for search path)
*/
void M_do_list(int n, const char *mapset)
{
int i;
if (n >= nlist) {
G_fatal_error(_("%s: invalid index %d"), "M_do_list()", n);
}
if (n < 0) {
for (i = 0; i < nlist; i++) {
G_list_element(list[i].element[0], list[i].desc[0], mapset, NULL);
}
}
else {
G_list_element(list[n].element[0], list[n].desc[0], mapset, NULL);
}
}
NULL
#define NULL
Definition ccmath.h:32
M_do_list
void M_do_list(int n, const char *mapset)
List elements.
Definition do_list.c:25
G_fatal_error
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
Definition gis/error.c:159
G_list_element
void G_list_element(const char *element, const char *desc, const char *mapset, int(*lister)(const char *, const char *, char *))
General purpose list function.
Definition gis/list.c:51
nlist
int nlist
Definition read_list.c:23
list
struct list * list
Definition read_list.c:24
element
Definition lidar.h:85