GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
mapset_msc.c File Reference

GIS library - Mapset user permission routines. More...

#include <grass/config.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for mapset_msc.c:

Go to the source code of this file.

Functions

int G_make_mapset_element (const char *p_element)
 Create element in the current mapset. More...
 
int G_make_mapset_element_tmp (const char *p_element)
 Create element in the temporary directory. More...
 
int G__make_mapset_element_misc (const char *dir, const char *name)
 Create misc element in the current mapset. More...
 
int G_mapset_permissions (const char *mapset)
 Check for user mapset permission. More...
 
int G_mapset_permissions2 (const char *gisdbase, const char *location, const char *mapset)
 Check for user mapset permission. More...
 

Detailed Description

GIS library - Mapset user permission routines.

(C) 1999-2014 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_msc.c.

Function Documentation

◆ G__make_mapset_element_misc()

int G__make_mapset_element_misc ( const char *  dir,
const char *  name 
)

Create misc element in the current mapset.

Parameters
dirdirectory path
nameelement to be created in mapset
Returns
0 no element defined
1 on success

Definition at line 112 of file mapset_msc.c.

References G_make_mapset_element(), and GNAME_MAX.

Referenced by I_fopen_signature_file_new(), I_fopen_sigset_file_new(), I_fopen_subgroup_file_append(), I_fopen_subgroup_file_new(), Rast__close_null(), and Rast__quant_export().

◆ G_make_mapset_element()

int G_make_mapset_element ( const char *  p_element)

Create element in the current mapset.

Make the specified element in the current mapset will check for the existence of the element and do nothing if it is found so this routine can be called even if the element already exists.

Calls G_fatal_error() on failure.

Parameters
p_elementelement to be created in mapset
Returns
0 no element defined
1 on success

Definition at line 38 of file mapset_msc.c.

References G_file_name(), G_mapset(), GPATH_MAX, and NULL.

Referenced by db_set_default_connection(), G__make_mapset_element_misc(), M_do_copy(), Rast3d_make_mapset_map_directory(), Rast__quant_export(), and Vect_copy().

◆ G_make_mapset_element_tmp()

int G_make_mapset_element_tmp ( const char *  p_element)

Create element in the temporary directory.

See G_file_name_tmp() for details.

Parameters
p_elementelement to be created in mapset
Returns
0 no element defined
1 on success

Definition at line 56 of file mapset_msc.c.

References G_file_name_tmp(), G_mapset(), GPATH_MAX, and NULL.

◆ G_mapset_permissions()

int G_mapset_permissions ( const char *  mapset)

Check for user mapset permission.

Parameters
mapsetmapset name
Returns
1 mapset exists, and user has permission
0 mapset exists, BUT user denied permission
-1 mapset does not exist

Definition at line 145 of file mapset_msc.c.

References G_file_name(), G_stat(), and GPATH_MAX.

◆ G_mapset_permissions2()

int G_mapset_permissions2 ( const char *  gisdbase,
const char *  location,
const char *  mapset 
)

Check for user mapset permission.

Parameters
gisdbasefull path to GISDBASE
locationlocation name
mapsetmapset name
Returns
1 mapset exists, and user has permission
0 mapset exists, BUT user denied permission
-1 mapset does not exist

Definition at line 174 of file mapset_msc.c.

References G_stat(), and GPATH_MAX.