GRASS 8 Programmer's Manual 8.6.0dev(2026)-b0a6d7703c
Loading...
Searching...
No Matches
vector/Vlib/color_remove.c
Go to the documentation of this file.
1/*!
2 \file lib/vector/Vlib/color_remove.c
3
4 \brief Vector Library - remove color table of vector map
5
6 SPDX-FileCopyrightText: 2011 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Martin Landa <landa.martin gmail.com>
10 */
11
12#include <string.h>
13
14#include <grass/gis.h>
15#include <grass/vector.h>
16
17/*!
18 \brief Remove color table of raster map
19
20 \param name name of raster map
21 \param mapset name of mapset
22
23 \return -1 on error
24 \return 0 color table not found
25 \return 1 on success
26 */
27int Vect_remove_colors(const char *name, const char *mapset)
28{
29 char element[GPATH_MAX];
31 int stat;
32
34 if (strcmp(xmapset, mapset) != 0)
35 return -1;
36 name = xname;
37 }
38
39 /* get rid of existing colr2, if any */
40 snprintf(element, sizeof(element), "%s/%s", GV_COLR2_DIRECTORY, mapset);
42
43 if (strcmp(mapset, G_mapset()) == 0) {
44 snprintf(element, sizeof(element), "%s/%s", GV_DIRECTORY, name);
46 }
47
48 return stat;
49}
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 GV_COLR2_DIRECTORY
Name of directory for alternative color tables.
Definition dig_defines.h:30
#define GV_DIRECTORY
Name of vector directory.
Definition dig_defines.h:8
#define GV_COLR_ELEMENT
Color table.
Definition dig_defines.h:28
#define GMAPSET_MAX
Definition gis.h:194
#define GPATH_MAX
Definition gis.h:196
#define GNAME_MAX
Definition gis.h:193
const char * name
Definition named_colr.c:6
int Vect_remove_colors(const char *name, const char *mapset)
Remove color table of raster map.