GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
make_mapset.c File Reference

GIS Library - Functions to create a new mapset within an existing location. More...

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

Go to the source code of this file.

Functions

int G_make_mapset (const char *gisdbase_name, const char *location_name, const char *mapset_name)
 Create a new mapset. More...
 

Detailed Description

GIS Library - Functions to create a new mapset within an existing location.

(C) 2006-2013 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
Joel Pitt, joel..nosp@m.pitt.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Definition in file make_mapset.c.

Function Documentation

◆ G_make_mapset()

int G_make_mapset ( const char *  gisdbase_name,
const char *  location_name,
const char *  mapset_name 
)

Create a new mapset.

This function creates a new mapset in the given location, initializes default window and the current window.

Calls G_fatal_error() if location doesn't exist.

Parameters
gisdbase_namefull path of GISDBASE to create mapset in (NULL for the current GISDBASE)
location_namename of location to create mapset in (NULL for the current location)
mapset_nameName of the new mapset. Should not include the full path, the mapset will be created within the specified database and location.
Returns
0 on success
-1 to indicate a system error (check errno).
-2 illegal name

Definition at line 43 of file make_mapset.c.

References _, G_create_alt_env(), G_fatal_error(), G_get_default_window(), G_gisdbase(), G_legal_filename(), G_location(), G_mkdir(), G_put_element_window(), G_setenv_nogisrc(), G_switch_env(), GPATH_MAX, and NULL.