21#include <grass/glocale.h>
44 const char *mapset_name)
47 struct Cell_head default_window;
50 if (location_name ==
NULL)
54 if (gisdbase_name ==
NULL)
65 sprintf(
path,
"%s/%s", gisdbase_name, location_name);
66 if (access(
path, F_OK) == -1)
67 G_fatal_error(_(
"Location <%s> doesn't exist"), location_name);
70 sprintf(
path,
"%s/%s/%s", gisdbase_name, location_name, mapset_name);
72 perror(
"G_make_mapset");
void G_switch_env(void)
Switch environments.
void G_setenv_nogisrc(const char *name, const char *value)
Set environment name to value (doesn't update .gisrc)
void G_create_alt_env(void)
Set up alternative environment variables.
void G_get_default_window(struct Cell_head *window)
Get the default region.
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
const char * G_gisdbase(void)
Get name of top level database directory.
int G_legal_filename(const char *s)
Check for legal database file name.
const char * G_location(void)
Get current location name.
int G_make_mapset(const char *gisdbase_name, const char *location_name, const char *mapset_name)
Create a new mapset.
int G_mkdir(const char *path)
Creates a new directory.
int G_put_element_window(const struct Cell_head *window, const char *dir, const char *name)
Write the region.