GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
color_remove.c
Go to the documentation of this file.
1
2
/****************************************************************************
3
*
4
* MODULE: gis library
5
* AUTHOR(S): Glynn Clements <glynn@gclements.plus.com>
6
* COPYRIGHT: (C) 2007 Glynn Clements
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
*****************************************************************************/
19
20
#include <string.h>
21
#include <stdio.h>
22
#include <grass/gis.h>
23
24
int
G_remove_colors
(
const
char
*
name
,
const
char
*mapset)
25
{
26
char
element[GMAPSET_MAX + 6];
27
char
xname[GNAME_MAX], xmapset[GMAPSET_MAX];
28
int
stat;
29
30
if
(
G__name_is_fully_qualified
(name, xname, xmapset)) {
31
if
(strcmp(xmapset, mapset) != 0)
32
return
-1;
33
name = xname;
34
}
35
36
/* get rid of existing colr2, if any */
37
sprintf(element,
"colr2/%s"
, mapset);
38
stat =
G_remove
(element, name);
39
40
if
(strcmp(mapset,
G_mapset
()) == 0)
41
stat =
G_remove
(
"colr"
, name);
42
43
return
stat;
44
}
lib
gis
color_remove.c
Generated on Sun Sep 9 2012 18:55:30 for GRASS Programmer's Manual by
1.8.1.2