19 #include <sys/types.h>
25 #include "local_proto.h"
27 static int check_coor(
struct Map_info *Map);
45 G_debug(1,
"V1_open_old_nat(): name = %s mapset = %s", Map->
name,
56 G_warning(
_(
"Unable to open coor file for vector map <%s>"),
67 G_debug(1,
"dig__read_head(): failed");
100 G_debug(1,
"V1_open_new_nat(): name = %s with_z = %d is_tmp = %d",
name,
127 if (access(
path, F_OK) == 0)
141 int check_coor(
struct Map_info *Map)
149 G_debug(1,
"coor size in head = %lu, real coor file size= %lu",
150 (
unsigned long)Map->
head.
size, (
unsigned long)CInfo.size);
154 _(
"Coor file of vector map <%s@%s> is larger than it should be "
155 "(%" PRId64
" bytes excess)"),
159 G_warning(
_(
"Coor file of vector <%s@%s> is shorter than it should be "
160 "(%" PRId64
" bytes missing)."),
FILE * G_fopen_old(const char *, const char *, const char *)
Open a database file for reading.
void G_warning(const char *,...) __attribute__((format(printf
FILE * G_fopen_modify(const char *, const char *)
Open a database file for update (r+ mode)
int G_debug(int, const char *,...) __attribute__((format(printf
FILE * G_fopen_new(const char *, const char *)
Open a new database file.
int Vect_coor_info(struct Map_info *, struct Coor_info *)
Update Coor_info structure.
const char * Vect_get_full_name(struct Map_info *)
Get fully qualified name of vector map.
#define GV_COOR_EARLIEST_MINOR
#define GV_COOR_VER_MAJOR
The latest versions of files known by current version of the library. Used for new files.
#define GV_COOR_ELEMENT
Native format, coordinates.
#define GV_COOR_VER_MINOR
#define GV_TOPO_ELEMENT
Native format, topology file.
#define GV_COOR_EARLIEST_MAJOR
The oldest versions of the library, which are capable to read the files created by the current versio...
int dig_file_load(struct gvfile *file)
Load opened struct gvfile to memory.
int dig__read_head(struct Map_info *)
int dig__byte_order_out(void)
Get byte order.
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
int dig__write_head(struct Map_info *)
void dig_file_init(struct gvfile *file)
Initialize gvfile structure.
int V1_open_old_nat(struct Map_info *Map, int update)
Open existing vector map (level 1)
int V1_open_new_nat(struct Map_info *Map, const char *name, int with_z)
Create new vector map (level 1)
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)
int byte_order
File byte order.
int minor
Current version (minor)
int back_major
Earliest version that can use this data format (major)
int back_minor
Earliest version that can use this data format (minor)
int major
Current version (major)
struct Version_info coor_version
Version info for coor file.
off_t size
Coor file size.
struct Port_info port
Portability information.
FILE * file
File descriptor.
char * Vect__get_path(char *path, struct Map_info *Map)
Get map directory name (internal use only)
char * Vect__get_element_path(char *file_path, struct Map_info *Map, const char *element)
Get map element full path (internal use only)