GRASS Programmer's Manual  6.4.1(2011)
find_cell.c File Reference
#include <grass/gis.h>
Include dependency graph for find_cell.c:

Go to the source code of this file.

Functions

char * G_find_cell (char *name, const char *mapset)
 find a raster map
char * G_find_cell2 (const char *name, const char *mapset)
 find a raster map (look but don't touch)

Function Documentation

char* G_find_cell ( char *  name,
const char *  mapset 
)

find a raster map

Looks for the raster map name in the database. The mapset parameter can either be the empty string "", which means search all the mapsets in the user's current mapset search path,

Remarks:
{See Mapset_Search_Path for more details about the search path.} or it can be a specific mapset name, which means look for the raster map only in this one mapset (for example, in the current mapset). If found, the mapset where the raster map lives is returned. If not found, the NULL pointer is returned.

NOTE: If the user specifies a fully qualified raster map which exists, then G_find_cell(~) modifies name by removing the "@<i>mapset</i>".

For example, to find a raster map anywhere in the database:

 char name[GNAME_MAX];
 char *mapset;
 if ((mapset = G_find_cell(name,"")) == NULL)
 // not found

To check that the raster map exists in the current mapset:

 char name[GNAME_MAX];
 if (G_find_cell(name,G_mapset( )) == NULL)
 // not found
Parameters:
name
mapset
Returns:
char *

Definition at line 63 of file find_cell.c.

References G_find_file().

Referenced by G__check_for_auto_masking(), G__mask_info(), G_get_cellhd(), and G_read_colors().

char* G_find_cell2 ( const char *  name,
const char *  mapset 
)

find a raster map (look but don't touch)

The same as G_find_cell() but doesn't remove the "@<i>mapset</i>" qualification from name, if present.

Returns NULL if the map wasn't found, or the mapset the raster was found in if it was.

Parameters:
name
mapset
Returns:
char *

Definition at line 83 of file find_cell.c.

References G_find_file2().

Referenced by G__check_fp_type(), G__open_cell_old(), G_check_input_output_name(), G_get_gdal_link(), G_raster_map_is_fp(), and G_raster_map_type().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines