GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
plus.c File Reference

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

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <grass/gis.h>
#include <grass/Vect.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)
 Init 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, GVFILE *plus, int head_only)
 Reads topo file to topo structure. More...
 
int dig_write_plus_file (GVFILE *fp_plus, struct Plus_head *Plus)
 Writes topo structure to topo file. More...
 
int dig_write_nodes (GVFILE *plus, struct Plus_head *Plus)
 Writes topo structure (nodes) to topo file. More...
 
int dig_write_lines (GVFILE *plus, struct Plus_head *Plus)
 Writes topo structure (lines) to topo file. More...
 
int dig_write_areas (GVFILE *plus, struct Plus_head *Plus)
 Writes topo structure (areas) to topo file. More...
 
int dig_write_isles (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 241 of file plus.c.

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

Referenced by 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 173 of file plus.c.

References G_debug(), G_free(), and NULL.

Referenced by dig_free_plus(), and Vect_build_nat().

void dig_free_plus_isles ( struct Plus_head *  Plus)

Free Plus->Isle structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 207 of file plus.c.

References G_debug(), G_free(), and NULL.

Referenced by dig_free_plus(), and Vect_build_nat().

void dig_free_plus_lines ( struct Plus_head *  Plus)

Free Plus->Line structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 137 of file plus.c.

References G_debug(), G_free(), and NULL.

Referenced by dig_free_plus(), and Vect_build_nat().

void dig_free_plus_nodes ( struct Plus_head *  Plus)

Free Plus->Node structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 105 of file plus.c.

References G_debug(), G_free(), and NULL.

Referenced by dig_free_plus(), and Vect_build_nat().

int dig_init_plus ( struct Plus_head *  Plus)

Init head structure.

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

Definition at line 31 of file plus.c.

References dig_cidx_init(), dig_spidx_init(), G_debug(), and NULL.

Referenced by dig_load_plus(), Vect__open_old(), and Vect_open_new().

int dig_load_plus ( struct Plus_head *  Plus,
GVFILE *  plus,
int  head_only 
)

Reads topo file to topo structure.

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

Definition at line 262 of file plus.c.

References dig_alloc_areas(), dig_alloc_isles(), dig_alloc_lines(), dig_alloc_nodes(), dig_fseek(), dig_init_plus(), dig_Rd_P_area(), dig_Rd_P_isle(), dig_Rd_P_line(), dig_Rd_P_node(), dig_Rd_Plus_head(), dig_set_cur_port(), G_debug(), and G_fatal_error().

Referenced by Vect_open_topo().

int dig_write_areas ( GVFILE *  plus,
struct Plus_head *  Plus 
)

Writes topo structure (areas) 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 437 of file plus.c.

References dig_ftell(), and dig_Wr_P_area().

Referenced by dig_write_plus_file().

int dig_write_isles ( GVFILE *  plus,
struct Plus_head *  Plus 
)

Writes topo structure (isles) 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 462 of file plus.c.

References dig_ftell(), and dig_Wr_P_isle().

Referenced by dig_write_plus_file().

int dig_write_lines ( GVFILE *  plus,
struct Plus_head *  Plus 
)

Writes topo structure (lines) 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 412 of file plus.c.

References dig_ftell(), and dig_Wr_P_line().

Referenced by dig_write_plus_file().

int dig_write_nodes ( GVFILE *  plus,
struct Plus_head *  Plus 
)

Writes topo structure (nodes) 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 388 of file plus.c.

References dig_ftell(), and dig_Wr_P_node().

Referenced by dig_write_plus_file().

int dig_write_plus_file ( 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 338 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(), and G_warning().

Referenced by Vect_save_topo().