GRASS Programmer's Manual 6.4.1(2011)
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.
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.
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 (name) which exists, then G_find_file() modifies name by removing the "@<i>mapset</i>" part.

Rejects all names that begin with "."

If name 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 G_find_cell(), and G_find_vector().

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.

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(), and G_get_3dview().

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.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines