GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
do_list.c
Go to the documentation of this file.
1/*!
2 \file lib/manage/do_list.c
3
4 \brief Manage Library - List elements
5
6 SPDX-FileCopyrightText: 2001-2012 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Original author CERL
10 */
11
12#include <grass/gis.h>
13#include <grass/glocale.h>
14
15#include "manage_local_proto.h"
16
17/*!
18 \brief List elements
19
20 \param n element index in the array (negative value for all elements)
21 \param mapset name of mapset ("" for search path)
22 */
23void M_do_list(int n, const char *mapset)
24{
25 int i;
26
27 if (n >= nlist) {
28 G_fatal_error(_("%s: invalid index %d"), "M_do_list()", n);
29 }
30
31 if (n < 0) {
32 for (i = 0; i < nlist; i++) {
33 G_list_element(list[i].element[0], list[i].desc[0], mapset, NULL);
34 }
35 }
36 else {
37 G_list_element(list[n].element[0], list[n].desc[0], mapset, NULL);
38 }
39}
#define NULL
Definition ccmath.h:32
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_list_element(const char *, const char *, const char *, int(*)(const char *, const char *, char *))
General purpose list function.
Definition gis/list.c:49
void M_do_list(int n, const char *mapset)
List elements.
Definition do_list.c:23
#define _(str)
Definition glocale.h:10
int nlist
Definition read_list.c:21
Definition manage.h:4