18 #include "gis_local_proto.h" 20 static char *file_name(
char *,
const char *,
const char *,
21 const char *,
const char *,
const char *);
22 static void append_char(
char*,
char);
39 const char *
element,
const char *
name,
const char *mapset)
41 return file_name(path,
NULL, element, name, mapset,
NULL);
58 const char *
name,
const char *mapset)
60 return file_name(path, dir, element, name, mapset,
NULL);
82 const char *
name,
const char *mapset)
84 const char *env, *tmp_path;
87 env =
getenv(
"GRASS_VECTOR_TMPDIR_MAPSET");
88 if (env && strcmp(env,
"0") == 0) {
89 tmp_path =
getenv(
"TMPDIR");
92 return file_name(path,
NULL, element, name, mapset, tmp_path);
95 char *file_name(
char *
path,
96 const char *dir,
const char *
element,
const char *
name,
97 const char *mapset,
const char *base)
99 const char *pname =
name;
102 sprintf(
path,
"%s", base);
118 else if (mapset && *mapset)
129 if (pname && *pname) {
145 if (pname && *pname) {
156 void append_char(
char* s,
char c)
char * G_file_name_tmp(char *path, const char *element, const char *name, const char *mapset)
Builds full path names to GIS data files in temporary directory (for internal use only) ...
void G_free(void *)
Free allocated memory.
char * G__location_path(void)
Get current location UNIX-like path (internal use only)
char * G_file_name(char *path, const char *element, const char *name, const char *mapset)
Builds full path names to GIS data files.
const char * G_mapset(void)
Get current mapset name.
char * G_file_name_misc(char *path, const char *dir, const char *element, const char *name, const char *mapset)
Builds full path names to GIS misc data files.
int G_name_is_fully_qualified(const char *, char *, char *)
Check if map name is fully qualified (map @ mapset)
int G_debug(int, const char *,...) __attribute__((format(printf