GRASS 8 Programmer's Manual 8.6.0dev(2026)-4bb960b182
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 SPDX-FileCopyrightText: 2007 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Glynn Clements
10 */
11
12#include <string.h>
13#include <stdio.h>
14#include <grass/gis.h>
15
16/*!
17 \brief Remove color table of raster map
18
19 \param name name of raster map
20 \param mapset name of mapset
21
22 \return -1 on error
23 \return 0 color table not found
24 \return 1 on success
25 */
26int Rast_remove_colors(const char *name, const char *mapset)
27{
28 char element[GMAPSET_MAX + 6];
30 int stat;
31
33 if (strcmp(xmapset, mapset) != 0)
34 return -1;
35 name = xname;
36 }
37
38 /* get rid of existing colr2, if any */
39 snprintf(element, sizeof(element), "colr2/%s", mapset);
41
42 if (strcmp(mapset, G_mapset()) == 0)
43 stat = G_remove("colr", name);
44
45 return stat;
46}
int G_name_is_fully_qualified(const char *, char *, char *)
Check if map name is fully qualified (map @ mapset)
Definition nme_in_mps.c:34
int G_remove(const char *, const char *)
Remove a database file.
Definition remove.c:41
const char * G_mapset(void)
Get current mapset name.
Definition gis/mapset.c:31
#define GMAPSET_MAX
Definition gis.h:194
#define GNAME_MAX
Definition gis.h:193
const char * name
Definition named_colr.c:6
int Rast_remove_colors(const char *name, const char *mapset)
Remove color table of raster map.