GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
raster/color_remove.c
Go to the documentation of this file.
1/*!
2 \file lib/raster/color_remove.c
3
4 \brief Raster Library - remove color table of raster map
5
6 (C) 2007 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 Glynn Clements
12 */
13
14#include <string.h>
15#include <stdio.h>
16#include <grass/gis.h>
17
18/*!
19 \brief Remove color table of raster map
20
21 \param name name of raster map
22 \param mapset name of mapset
23
24 \return -1 on error
25 \return 0 color table not found
26 \return 1 on success
27 */
28int Rast_remove_colors(const char *name, const char *mapset)
29{
30 char element[GMAPSET_MAX + 6];
32 int stat;
33
35 if (strcmp(xmapset, mapset) != 0)
36 return -1;
37 name = xname;
38 }
39
40 /* get rid of existing colr2, if any */
41 snprintf(element, sizeof(element), "colr2/%s", mapset);
43
44 if (strcmp(mapset, G_mapset()) == 0)
45 stat = G_remove("colr", name);
46
47 return stat;
48}
int G_name_is_fully_qualified(const char *, char *, char *)
Check if map name is fully qualified (map @ mapset)
Definition nme_in_mps.c:36
int G_remove(const char *, const char *)
Remove a database file.
Definition remove.c:43
const char * G_mapset(void)
Get current mapset name.
Definition gis/mapset.c:33
#define GMAPSET_MAX
Definition gis.h:197
#define GNAME_MAX
Definition gis.h:196
const char * name
Definition named_colr.c:6
int Rast_remove_colors(const char *name, const char *mapset)
Remove color table of raster map.