19 #include <sys/types.h>
31 G_debug(3,
"dig_write_cidx_head()");
64 for (i = 0; i < plus->
n_cidx; i++) {
68 ci = &(plus->
cidx[i]);
124 unsigned char buf[5];
140 "Cidx header: file version %d.%d , supported from GRASS version %d.%d",
144 G_debug(3,
" byte order %d", byte_order);
156 G_debug(1,
"Category index format version %d.%d",
158 G_fatal_error(
_(
"This version of GRASS (%d.%d) is too old to read "
159 "this category index format."
160 " Try to rebuild topology or upgrade GRASS to at "
161 "least version %d."),
167 G_warning(
"Your GRASS version does not fully support category index "
168 "format %d.%d of the vector."
169 " Consider to rebuild topology or upgrade GRASS.",
202 for (i = 0; i < plus->
n_cidx; i++) {
206 ci = &(plus->
cidx[i]);
262 for (i = 0; i < plus->
n_cidx; i++) {
266 ci = &(plus->
cidx[i]);
270 for (j = 0; j < ci->
n_cats; j++)
277 for (j = 0; j < ci->
n_cats; j++)
307 G_debug(3,
"Cannot read cidx head");
319 for (i = 0; i < plus->
n_cidx; i++) {
323 ci = &(plus->
cidx[i]);
334 for (j = 0; j < ci->
n_cats; j++)
int dig_write_cidx(struct gvfile *fp, struct Plus_head *plus)
int dig_read_cidx(struct gvfile *fp, struct Plus_head *plus, int head_only)
Read spatial index file.
int dig_write_cidx_head(struct gvfile *fp, struct Plus_head *plus)
int dig_read_cidx_head(struct gvfile *fp, struct Plus_head *plus)
Read header of cidx file.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
#define GV_CIDX_VER_MINOR
#define GV_CIDX_EARLIEST_MINOR
#define GV_CIDX_EARLIEST_MAJOR
#define GV_CIDX_VER_MAJOR
int dig__fread_port_O(off_t *, size_t, struct gvfile *, size_t)
Read off_ts from the Portable Vector Format.
int dig__fwrite_port_C(const char *, size_t, struct gvfile *)
Write chars to the Portable Vector Format.
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
int dig__fread_port_L(long *, size_t, struct gvfile *)
Read longs from the Portable Vector Format.
int dig__fwrite_port_L(const long *, size_t, struct gvfile *)
Write longs to the Portable Vector Format.
int dig__fwrite_port_I(const int *, size_t, struct gvfile *)
Write integers to the Portable Vector Format.
off_t dig_ftell(struct gvfile *file)
Get struct gvfile position.
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
void dig_cidx_free(struct Plus_head *)
void dig_rewind(struct gvfile *file)
Rewind file position.
int dig__fread_port_C(char *, size_t, struct gvfile *)
Read chars from the Portable Vector Format.
int dig_cidx_init(struct Plus_head *)
Initialize Plus_head structure (cidx)
int dig__fread_port_I(int *, size_t, struct gvfile *)
Read integers from the Portable Vector Format.
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
int dig_type_from_store(int)
Convert type from store type.
int dig__fwrite_port_O(const off_t *, size_t, struct gvfile *, size_t)
Write off_ts to the Portable Vector Format.
int dig_type_to_store(int)
Convert type to store type.
int n_types
Number of types in type.
int(* cat)[3]
Array of cats (cat, type, lines/area)
int a_cats
Allocated space in cat array.
int n_cats
Number of items in cat array.
off_t offset
Offset of the beginning of this index in cidx file.
int field
Field (layer) number.
int type[7][2]
Number of elements for each type.
int n_ucats
Number of unique cats (not updated)
Basic topology-related info.
int n_cidx
Number of category indexes (one for each field/layer)
struct Port_info cidx_port
Portability information for category index.
off_t coor_size
Size of coor file.
struct Plus_head::@9 version
Backward compatibility version info.
int off_t_size
Offset size.
int a_cidx
Allocated space for category indexes.
int cidx_up_to_date
Category index to be updated.
struct Version_info cidx
Version info for category index file.
long cidx_head_size
Category index header size.
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)
#define GRASS_VERSION_MINOR
#define GRASS_VERSION_MAJOR