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