GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
reclass.c File Reference
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for reclass.c:

Go to the source code of this file.

Functions

int G_is_reclass (const char *name, const char *mapset, char *rname, char *rmapset)
 reclass file? More...
 
int G_is_reclassed_to (const char *name, const char *mapset, int *nrmaps, char ***rmaps)
 get child reclass maps list More...
 
int G_get_reclass (const char *name, const char *mapset, struct Reclass *reclass)
 
int G_free_reclass (struct Reclass *reclass)
 
int G_put_reclass (const char *name, const struct Reclass *reclass)
 

Function Documentation

int G_free_reclass ( struct Reclass *  reclass)

Definition at line 155 of file reclass.c.

References G_free(), and NULL.

int G_get_reclass ( const char *  name,
const char *  mapset,
struct Reclass *  reclass 
)

Definition at line 117 of file reclass.c.

References fclose(), fd, G_warning(), NULL, and stat.

Referenced by G__open_cell_old().

int G_is_reclass ( const char *  name,
const char *  mapset,
char *  rname,
char *  rmapset 
)

reclass file?

This function determines if the raster map name in mapset is a reclass file. If it is, then the name and mapset of the referenced raster map are copied into the r_name and r_mapset buffers. Returns 1 if name is a reclass file, 0 if it is not, and -1 if there was a problem reading the raster header for name.

Parameters
name
mapset
r_name
r_mapset
Returns
int

Definition at line 30 of file reclass.c.

References fclose(), fd, NULL, and dialogs::type.

Referenced by G__mask_info(), and G_get_cellhd().

int G_is_reclassed_to ( const char *  name,
const char *  mapset,
int nrmaps,
char ***  rmaps 
)

get child reclass maps list

This function generates a child reclass maps list from the cell_misc/reclassed_to file which stores this list. The cell_misc/reclassed_to file is written by G_put_reclass(). G_is_reclassed_to() is used by g.rename, g.remove and r.reclass to prevent accidentally deleting the parent map of a reclassed raster map.

Parameters
name
mapset
nrmaps
rmaps
Returns
int

Definition at line 66 of file reclass.c.

References buf2, fclose(), fd, G_fopen_old_misc(), l, and NULL.

int G_put_reclass ( const char *  name,
const struct Reclass *  reclass 
)