11 #include <grass/gis.h>
15 char buffer[GPATH_MAX];
18 struct Cell_head window;
21 sprintf(buffer,
"%s/%s", location, mapset);
29 G_asprintf(&buffer2,
"%s/%s/VAR", location, mapset);
30 if ((fd = fopen(buffer2,
"w")) ==
NULL) {
32 G_fatal_error(
"Cannot create <%s> file in new mapset", buffer2);
34 fprintf(fd,
"DB_DRIVER: dbf\n");
35 fprintf(fd,
"DB_DATABASE: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/\n");
40 sprintf(buffer,
"%s/%s/dbf", location, mapset);
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
void G_free(void *buf)
Free allocated memory.
int G_mkdir(const char *path)
Creates a new directory.
int make_mapset(const char *, const char *)
int G_get_default_window(struct Cell_head *window)
read the default region
int G_asprintf(char **out, const char *fmt,...)
int G_put_window(const struct Cell_head *window)
write the database region
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.