GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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 174 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(), Vect__open_old(), and Vect_close().

void dig_free_plus_areas ( struct Plus_head Plus)

Free Plus->Area structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 115 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(), and Vect__build_downgrade().

void dig_free_plus_isles ( struct Plus_head Plus)

Free Plus->Isle structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 143 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(), and Vect__build_downgrade().

void dig_free_plus_lines ( struct Plus_head Plus)
void dig_free_plus_nodes ( struct Plus_head Plus)

Free Plus->Node structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 51 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(), and Vect__build_downgrade().

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 31 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(), Vect__open_old(), and Vect__open_topo_pg().

int dig_load_plus ( struct Plus_head Plus,
struct gvfile plus,
int  head_only 
)
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 371 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().

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 396 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().

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 346 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().

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 322 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().

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 272 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().