GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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

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. More...
 
char * G_find_file_misc (const char *dir, const char *element, char *name, const char *mapset)
 
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. More...
 
char * G_find_file2_misc (const char *dir, const char *element, const char *name, const char *mapset)
 

Detailed Description

GIS library - find GRASS data base files.

(C) 2001-2008 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

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.

notes:

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

Rejects all names that begin with "."

If <b>name</b> is of the form nnn in ppp then only mapset ppp
is searched.
Parameters
constchar *element database element (eg, "cell", "cellhd", "colr", etc)
char*name file name to look for
constchar *mapset mapset to search. if mapset is "" will search in mapset search list
Returns
char * pointer to a string with name of mapset where file was found, or NULL if not found

Definition at line 159 of file find_file.c.

References NULL.

Referenced by G3d_maskFileExists(), G_find_cell(), G_find_vector(), IL_output_2d(), IL_resample_output_2d(), and S_read().

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 <b>name</b> is in
the form "<i>name@mapset</i>", and is found, G_find_file2() will not
alter <b>name</b> by removing the "@<i>mapset</i>" part.

note: rejects all names that begin with "."

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

Definition at line 191 of file find_file.c.

References NULL.

Referenced by G_find_cell2(), G_find_vector2(), G_get_3dview(), Gs_load_3dview(), I_find_group(), and Vect_open_new().

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

Definition at line 164 of file find_file.c.