GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mapset_nme.c File Reference

GIS library - Mapset name, search path routines. More...

#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <grass/gis.h>
Include dependency graph for mapset_nme.c:

Go to the source code of this file.

Functions

char * G__mapset_name (int n)
 Get name of the n'th mapset from the mapset_name[] list. More...
 
int G__create_alt_search_path (void)
 Define alternative mapset search path. More...
 
int G__switch_search_path (void)
 Switch mapset search path. More...
 
int G_reset_mapsets (void)
 Reset number of mapsets. More...
 
char ** G_available_mapsets (void)
 Get list of available mapsets for current location. More...
 
void G_add_mapset_to_search_path (const char *mapset)
 Add mapset to the list of mapsets in search path. More...
 
int G_is_mapset_in_search_path (const char *mapset)
 Check if given mapset is in search path. More...
 

Detailed Description

GIS library - Mapset name, search path routines.

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

Definition in file mapset_nme.c.

Function Documentation

int G__create_alt_search_path ( void  )

Define alternative mapset search path.

Returns
0

Definition at line 106 of file mapset_nme.c.

char* G__mapset_name ( int  n)

Get name of the n'th mapset from the mapset_name[] list.

The first call will initialize the list.

Parameters
nmapset index
Returns
mapset name
NULL if mapset not found

Definition at line 36 of file mapset_nme.c.

References n, and NULL.

Referenced by G_list_element().

int G__switch_search_path ( void  )

Switch mapset search path.

Returns
0

Definition at line 121 of file mapset_nme.c.

References n.

void G_add_mapset_to_search_path ( const char *  mapset)

Add mapset to the list of mapsets in search path.

Mapset is add in memory only, not to the SEARCH_PATH file! List is check first if already exists.

Parameters
mapsetmapset name

Definition at line 220 of file mapset_nme.c.

References G_is_mapset_in_search_path().

char** G_available_mapsets ( void  )

Get list of available mapsets for current location.

List is updated by each call to this function

Returns
pointer to zero terminated array of available mapsets.

Definition at line 157 of file mapset_nme.c.

References buf, G_debug(), G_free(), G_location_path(), G_store(), python.core::mapsets(), n, NULL, opendir(), readdir(), sprintf(), and stat.

int G_is_mapset_in_search_path ( const char *  mapset)

Check if given mapset is in search path.

Parameters
mapsetmapset name
Returns
1 mapset found in search path
0 mapset not found

Definition at line 234 of file mapset_nme.c.

Referenced by G_add_mapset_to_search_path().

int G_reset_mapsets ( void  )

Reset number of mapsets.

Returns
0

Definition at line 143 of file mapset_nme.c.