GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
plus_struct.c File Reference
#include <inttypes.h>
#include <sys/types.h>
#include <string.h>
#include <grass/vector.h>
#include <grass/glocale.h>
#include <grass/version.h>
Include dependency graph for plus_struct.c:

Go to the source code of this file.

Functions

int dig_Rd_P_node (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Wr_P_node (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Rd_P_line (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Wr_P_line (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Rd_P_area (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Wr_P_area (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Rd_P_isle (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Wr_P_isle (struct Plus_head *Plus, int n, struct gvfile *fp)
 
int dig_Rd_Plus_head (struct gvfile *fp, struct Plus_head *ptr)
 Read Plus_head from file. More...
 
int dig_Wr_Plus_head (struct gvfile *fp, struct Plus_head *ptr)
 Write Plus_head to file. More...
 

Function Documentation

◆ dig_Rd_P_area()

◆ dig_Rd_P_isle()

int dig_Rd_P_isle ( struct Plus_head Plus,
int  n,
struct gvfile fp 
)

◆ dig_Rd_P_line()

◆ dig_Rd_P_node()

◆ dig_Rd_Plus_head()

◆ dig_Wr_P_area()

int dig_Wr_P_area ( struct Plus_head Plus,
int  n,
struct gvfile fp 
)

◆ dig_Wr_P_isle()

int dig_Wr_P_isle ( struct Plus_head Plus,
int  n,
struct gvfile fp 
)

◆ dig_Wr_P_line()

◆ dig_Wr_P_node()

int dig_Wr_P_node ( struct Plus_head Plus,
int  n,
struct gvfile fp 
)

◆ dig_Wr_Plus_head()

int dig_Wr_Plus_head ( struct gvfile fp,
struct Plus_head ptr 
)

Write Plus_head to file.

ptr->off_t_size is used for both coor and topo files, but their sizes (ptr->coor_size for coor and no variable for topo) can be different. If either file is greater than PORT_LONG_MAX, ptr->off_t_size must be 8. This function determines this value of ptr->off_t_size and writes it to the file.

Parameters
fppointer to gvfile structure
[in,out]ptrpointer to Plus_head structure
Returns
-1 error
0 OK

Definition at line 711 of file plus_struct.c.

References Plus_head::Area, Plus_head::Area_offset, bound_box::B, Plus_head::box, Port_info::byte_order, Plus_head::coor_size, dig__fwrite_port_C(), dig__fwrite_port_D(), dig__fwrite_port_L(), dig__fwrite_port_O(), dig__fwrite_port_P(), dig_ftell(), dig_rewind(), dig_set_cur_port(), bound_box::E, Plus_head::Edge_offset, G_debug(), GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_TOPO_EARLIEST_MAJOR, GV_TOPO_EARLIEST_MINOR, GV_TOPO_VER_MAJOR, GV_TOPO_VER_MINOR, Plus_head::Hole_offset, Plus_head::Isle, Plus_head::Isle_offset, Plus_head::Line, Plus_head::Line_offset, bound_box::N, Plus_head::n_areas, Plus_head::n_blines, Plus_head::n_clines, Plus_head::n_edges, Plus_head::n_flines, Plus_head::n_holes, Plus_head::n_isles, P_area::n_isles, Plus_head::n_klines, Plus_head::n_lines, P_node::n_lines, P_area::n_lines, P_isle::n_lines, Plus_head::n_llines, Plus_head::n_nodes, Plus_head::n_plines, Plus_head::n_volumes, Plus_head::Node, Plus_head::Node_offset, NULL, Plus_head::off_t_size, Plus_head::port, PORT_LONG_MAX, bound_box::S, bound_box::T, P_line::type, Plus_head::Volume_offset, bound_box::W, and Plus_head::with_z.

Referenced by dig_write_plus_file().