GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72086
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
find_file.c File Reference

GIS library - Find GRASS data base files. More...

#include <string.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for find_file.c:

Go to the source code of this file.

Functions

const char * G_find_file (const char *element, char *name, const char *mapset)
 Searches for a file from the mapset search list or in a specified mapset. More...
 
const char * G_find_file_misc (const char *dir, const char *element, char *name, const char *mapset)
 Searches for a file from the mapset search list or in a specified mapset. More...
 
const char * G_find_file2 (const char *element, const char *name, const char *mapset)
 Searches for a file from the mapset search list or in a specified mapset. (look but don't touch) More...
 
const char * G_find_file2_misc (const char *dir, const char *element, const char *name, const char *mapset)
 Searches for a file from the mapset search list or in a specified mapset. (look but don't touch) More...
 

Detailed Description

GIS library - Find GRASS data base files.

(C) 2001-2009 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Original author CERL

Definition in file find_file.c.

Function Documentation

const char* G_find_file ( const char *  element,
char *  name,
const char *  mapset 
)

Searches for a file from the mapset search list or in a specified mapset.

Returns the mapset name where the file was found.

If the user specifies a fully qualified element (name) which exists, then G_find_file() modifies "name" by removing the "@mapset" part.

Rejects all names that begin with "."

If name is of the form nnn in ppp then only mapset ppp is searched.

Parameters
elementdatabase element (eg, "cell", "cellhd", "colr", etc)
namefile name to look for
mapsetmapset to search. if mapset is "" will search in mapset search list
Returns
pointer to a string with name of mapset where file was found, or NULL if not found

Definition at line 203 of file find_file.c.

References NULL.

Referenced by G_find_raster(), G_find_vector(), IL_output_2d(), IL_resample_output_2d(), and S_read().

const char* G_find_file2 ( const char *  element,
const char *  name,
const char *  mapset 
)

Searches for a file from the mapset search list or in a specified mapset. (look but don't touch)

Returns the mapset name where the file was found.

Exactly the same as G_find_file() except that if name is in the form "<i>name@mapset</i>", and is found, G_find_file2() will not alter name by removing the "@<i>mapset</i>" part.

Rejects all names that begin with "."

Parameters
elementdatabase element (eg, "cell", "cellhd", "colr", etc)
namefile name to look for
mapsetmapset to search. if mapset is "" will search in mapset search list
Returns
pointer to a string with name of mapset where file was found, or NULL if not found

Definition at line 247 of file find_file.c.

References NULL.

Referenced by G_find_raster2(), G_find_vector2(), G_get_3dview(), Gs_load_3dview(), I_find_group(), IL_resample_output_2d(), M_find(), V1_close_ogr(), and Vect_close().

const char* G_find_file2_misc ( const char *  dir,
const char *  element,
const char *  name,
const char *  mapset 
)

Searches for a file from the mapset search list or in a specified mapset. (look but don't touch)

Returns the mapset name where the file was found.

Parameters
dirfile directory
elementdatabase element (eg, "cell", "cellhd", "colr", etc)
namefile name to look for
mapsetmapset to search. if mapset is "" will search in mapset search list
Returns
pointer to a string with name of mapset where file was found, or NULL if not found

Definition at line 267 of file find_file.c.

Referenced by G_find_raster3d(), G_has_raster3d_timestamp(), G_has_raster_timestamp(), I_find_group_file(), I_find_signature_file(), I_find_subgroup(), I_find_subgroup_file(), Rast_read_fp_range(), Rast_read_histogram(), Rast_read_range(), and Rast_read_rstats().

const char* G_find_file_misc ( const char *  dir,
const char *  element,
char *  name,
const char *  mapset 
)

Searches for a file from the mapset search list or in a specified mapset.

Returns the mapset name where the file was found.

Parameters
dirfile directory
elementdatabase element (eg, "cell", "cellhd", "colr", etc)
namefile name to look for
mapsetmapset to search. if mapset is "" will search in mapset search list
Returns
pointer to a string with name of mapset where file was found, or NULL if not found

Definition at line 222 of file find_file.c.

Referenced by Rast3d_mask_file_exists().