4
4
\brief Imagery Library - List subgroup
6
(C) 2001-2008 by the GRASS Development Team
6
(C) 2001-2008,2013 by the GRASS Development Team
8
8
This program is free software under the GNU General Public License
9
9
(>=v2). Read the file COPYING that comes with GRASS for details.
14
14
#include <string.h>
15
15
#include <grass/imagery.h>
16
16
#include <grass/glocale.h>
19
* \brief Get list of subgroups which a group contatins.
21
* \param group group name
22
* \param[out] subgs_num number of subgroups which the group contains
23
* \return array of subgroup names
26
char **I_list_subgroups(const char *group, int *subgs_num)
28
/* Unlike I_list_subgroup and I_list_subgroup_simple this function
29
returns array of subgroup names, it does not use fprintf.
30
This approach should make the function usable in more cases. */
40
if (I_find_group(group) == 0)
44
sprintf(buf, "group/%s/subgroup", group);
45
G_file_name(path, buf, "", mapset);
47
if (!G_lstat(path, &sb) == 0 || !S_ISDIR(sb.st_mode))
50
subgs = G_ls2(path, subgs_num);
19
55
* \brief Prints maps in a subgroup (fancy version)
21
57
* \param group group name
48
_("subgroup <%s> of group <%s> references the following raster maps\n"),
85
("subgroup <%s> of group <%s> references the following raster maps\n"),
50
87
fprintf(fd, "-------------\n");