24 #include "local_proto.h"
58 char *env = getenv(
"GRASS_VECTOR_TEMPORARY");
61 if (Map->
temporary == TEMPORARY_MAP_ENV && env) {
67 "V1_close_nat(): temporary map <%s> TO BE MOVED TO"
73 if (access(path_map, 0) != 0 &&
G_mkdir(path_map) != 0)
79 G_debug(1,
"V1_close_nat(): %s -> %s", path_tmp, path_map);
84 #ifdef TEMPORARY_MAP_DB
92 G_debug(1,
"V1_close_nat(): copying attributes");
97 for (i = 0; i < ndblinks; i++) {
122 G_debug(1,
"V1_close_nat(): temporary map <%s> TO BE DELETED",
127 G_debug(1,
"V1_close_nat(): temporary map <%s> IS NOT DELETED",
132 else if (Map->
temporary == TEMPORARY_MAP) {
133 G_debug(1,
"V1_close_nat(): temporary map <%s> TO BE DELETED",
145 #ifndef TEMPORARY_MAP_DB
158 for (i = 0; i < ndblinks; i++) {
165 _(
"Unable to open database <%s> by driver <%s>"),
int V1_close_nat(struct Map_info *Map)
Close vector map.
dbDriver * db_start_driver_open_database(const char *, const char *)
Open driver/database connection.
int db_drop_table(dbDriver *, dbString *)
Drop table.
int db_get_connection(dbConnection *)
Get default DB connection settings for the current mapset.
int db_set_string(dbString *, const char *)
Inserts string to dbString (enlarge string)
void db_init_string(dbString *)
Initialize dbString.
int db_copy_table(const char *, const char *, const char *, const char *, const char *, const char *)
Copy a table.
int G_recursive_copy(const char *, const char *)
Copy recursively source directory to destination directory.
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
int int G_strcasecmp(const char *, const char *)
String compare ignoring case (upper or lower)
int G_recursive_remove(const char *)
Recursively remove all files in given directory.
int G_mkdir(const char *)
Creates a new directory.
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_add_dblink(struct dblinks *, int, const char *, const char *, const char *, const char *, const char *)
Add new DB connection to dblinks structure.
int Vect_coor_info(struct Map_info *, struct Coor_info *)
Update Coor_info structure.
struct dblinks * Vect_new_dblinks_struct(void)
Create and init new dblinks structure.
int Vect_write_dblinks(struct Map_info *)
Write dblinks to file.
int Vect_get_num_dblinks(struct Map_info *)
Get number of defined dblinks.
struct field_info * Vect_get_dblink(struct Map_info *, int)
Get information about link to database.
int Vect__write_head(struct Map_info *)
Writes head information to text file (GV_HEAD_ELEMENT)
#define VECT_OPEN(Map)
Check if vector map is open.
#define GV_DIRECTORY
Name of vector directory.
#define GV_MODE_WRITE
Write vector map open mode.
#define GV_MODE_RW
Read-write vector map open mode.
int dig__write_head(struct Map_info *)
void dig_file_free(struct gvfile *file)
Free struct gvfile.
const struct driver * driver
off_t size
Total size (in bytes)
char * mapset
Mapset name.
int temporary
Temporary map flag.
struct gvfile dig_fp
GV file pointer (native format only)
struct dig_head head
Header info.
char * name
Map name (for 4.0)
struct dblinks * dblnk
Array of DB links.
off_t size
Coor file size.
Layer (old: field) information.
char * table
Name of DB table.
char * driver
Name of DB driver ('sqlite', 'dbf', ...)
char * name
Layer name (optional)
char * key
Name of key column (usually 'cat')
FILE * file
File descriptor.
char * Vect__get_element_path(char *file_path, struct Map_info *Map, const char *element)
Get map element full path (internal use only)