GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-602118adcc
plus.c File Reference

Vector library - update topo structure (lower level functions) More...

#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <grass/vector.h>
#include <grass/glocale.h>
Include dependency graph for plus.c:

Go to the source code of this file.

Functions

int dig_init_plus (struct Plus_head *Plus)
 Initialize Plus_head structure. More...
 
void dig_free_plus_nodes (struct Plus_head *Plus)
 Free Plus->Node structure. More...
 
void dig_free_plus_lines (struct Plus_head *Plus)
 Free Plus->Line structure. More...
 
void dig_free_plus_areas (struct Plus_head *Plus)
 Free Plus->Area structure. More...
 
void dig_free_plus_isles (struct Plus_head *Plus)
 Free Plus->Isle structure. More...
 
void dig_free_plus (struct Plus_head *Plus)
 Free Plus structure. More...
 
int dig_load_plus (struct Plus_head *Plus, struct gvfile *plus, int head_only)
 Reads topo file to topo structure. More...
 
int dig_write_plus_file (struct gvfile *fp_plus, struct Plus_head *Plus)
 Writes topo structure to topo file. More...
 
int dig_write_nodes (struct gvfile *plus, struct Plus_head *Plus)
 Writes topo structure (nodes) to topo file. More...
 
int dig_write_lines (struct gvfile *plus, struct Plus_head *Plus)
 Writes topo structure (lines) to topo file. More...
 
int dig_write_areas (struct gvfile *plus, struct Plus_head *Plus)
 Writes topo structure (areas) to topo file. More...
 
int dig_write_isles (struct gvfile *plus, struct Plus_head *Plus)
 Writes topo structure (isles) to topo file. More...
 

Detailed Description

Vector library - update topo structure (lower level functions)

Lower level functions for reading/writing/manipulating vectors.

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
CERL (probably Dave Gerdes), Radim Blazek
Date
2001-2006

Definition in file plus.c.

Function Documentation

◆ dig_free_plus()

void dig_free_plus ( struct Plus_head Plus)

Free Plus structure.

Structure is not inited and dig_init_plus() should follow.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 173 of file plus.c.

References dig_cidx_free(), dig_free_plus_areas(), dig_free_plus_isles(), dig_free_plus_lines(), dig_free_plus_nodes(), dig_spidx_free(), and G_debug().

Referenced by dig_load_plus().

◆ dig_free_plus_areas()

void dig_free_plus_areas ( struct Plus_head Plus)

Free Plus->Area structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 114 of file plus.c.

References Plus_head::alloc_areas, Plus_head::Area, dig_free_area(), G_debug(), G_free(), Plus_head::n_areas, and NULL.

Referenced by dig_free_plus().

◆ dig_free_plus_isles()

void dig_free_plus_isles ( struct Plus_head Plus)

Free Plus->Isle structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 142 of file plus.c.

References Plus_head::alloc_isles, dig_free_isle(), G_debug(), G_free(), Plus_head::Isle, Plus_head::n_isles, and NULL.

Referenced by dig_free_plus().

◆ dig_free_plus_lines()

void dig_free_plus_lines ( struct Plus_head Plus)

◆ dig_free_plus_nodes()

void dig_free_plus_nodes ( struct Plus_head Plus)

Free Plus->Node structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 50 of file plus.c.

References Plus_head::alloc_nodes, dig_free_node(), G_debug(), G_free(), Plus_head::n_nodes, Plus_head::Node, and NULL.

Referenced by dig_free_plus().

◆ dig_init_plus()

int dig_init_plus ( struct Plus_head Plus)

Initialize Plus_head structure.

Parameters
[in,out]Pluspointer to Plus_head structure
Returns
1

Definition at line 30 of file plus.c.

References Plus_head::built, dig_cidx_init(), dig_spidx_init(), G_debug(), G_zero(), and GV_BUILD_NONE.

Referenced by dig_load_plus().

◆ dig_load_plus()

int dig_load_plus ( struct Plus_head Plus,
struct gvfile plus,
int  head_only 
)

◆ dig_write_areas()

int dig_write_areas ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (areas) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 368 of file plus.c.

References Plus_head::Area_offset, dig_ftell(), dig_Wr_P_area(), and Plus_head::n_areas.

Referenced by dig_write_plus_file().

◆ dig_write_isles()

int dig_write_isles ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (isles) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 392 of file plus.c.

References dig_ftell(), dig_Wr_P_isle(), Plus_head::Isle_offset, and Plus_head::n_isles.

Referenced by dig_write_plus_file().

◆ dig_write_lines()

int dig_write_lines ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (lines) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 344 of file plus.c.

References dig_ftell(), dig_Wr_P_line(), Plus_head::Line_offset, and Plus_head::n_lines.

Referenced by dig_write_plus_file().

◆ dig_write_nodes()

int dig_write_nodes ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (nodes) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 321 of file plus.c.

References dig_ftell(), dig_Wr_P_node(), Plus_head::n_nodes, and Plus_head::Node_offset.

Referenced by dig_write_plus_file().

◆ dig_write_plus_file()

int dig_write_plus_file ( struct gvfile fp_plus,
struct Plus_head Plus 
)

Writes topo structure to topo file.

Parameters
[in,out]fp_plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 271 of file plus.c.

References _, dig_fflush(), dig_rewind(), dig_set_cur_port(), dig_Wr_Plus_head(), dig_write_areas(), dig_write_isles(), dig_write_lines(), dig_write_nodes(), G_warning(), and Plus_head::port.

Referenced by Vect_save_topo().