GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-602118adcc
|
Vector library - allocate and zero array space (lower level functions) More...
Go to the source code of this file.
Functions | |
struct P_node * | dig_alloc_node (void) |
Allocate new node structure. More... | |
void | dig_free_node (struct P_node *Node) |
Free node structure. More... | |
int | dig_node_alloc_line (struct P_node *node, int add) |
Allocate space in P_node struct. More... | |
int | dig_alloc_nodes (struct Plus_head *Plus, int add) |
Reallocate array of pointers to nodes. More... | |
struct P_line * | dig_alloc_line (void) |
Allocate new line structure. More... | |
void * | dig_alloc_topo (char type) |
Allocate new topo struct. More... | |
void | dig_free_line (struct P_line *Line) |
Free line structure. More... | |
int | dig_alloc_lines (struct Plus_head *Plus, int add) |
Reallocate array of pointers to lines. More... | |
int | dig_alloc_areas (struct Plus_head *Plus, int add) |
Reallocate array of pointers to areas. More... | |
int | dig_alloc_isles (struct Plus_head *Plus, int add) |
Reallocate array of pointers to isles. More... | |
struct P_area * | dig_alloc_area (void) |
Allocate new area structure. More... | |
void | dig_free_area (struct P_area *Area) |
Free area structure. More... | |
struct P_isle * | dig_alloc_isle (void) |
Allocate new isle structure. More... | |
void | dig_free_isle (struct P_isle *Isle) |
Free isle structure. More... | |
int | dig_alloc_points (struct line_pnts *points, int num) |
allocate room for 'num' X and Y arrays in struct line_pnts More... | |
int | dig_alloc_cats (struct line_cats *cats, int num) |
Allocate room for 'num' fields and category arrays in struct line_cats. More... | |
int | dig_area_alloc_line (struct P_area *area, int add) |
allocate space in P_area for add new lines More... | |
int | dig_area_alloc_isle (struct P_area *area, int add) |
Allocate space in P_area for add new isles. More... | |
int | dig_isle_alloc_line (struct P_isle *isle, int add) |
Allocate space in P_isle for add new lines. More... | |
int | dig_out_of_memory (void) |
For now just print message and return error code. More... | |
Vector library - allocate and zero array space (lower level functions)
Lower level functions for reading/writing/manipulating vectors.
These routines all eventually call calloc() to allocate and zero the new space. BUT It is not necessarily safe to assume that the memory will be zero. The next memory location asked for could have been previously used and not zeroed. (e.g. compress()).
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file struct_alloc.c.
struct P_area* dig_alloc_area | ( | void | ) |
Allocate new area structure.
Definition at line 266 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_Rd_P_area().
int dig_alloc_areas | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to areas.
Plus | pointer to Plus_head structure |
add | space for 'add' number of areas is added |
Definition at line 218 of file struct_alloc.c.
Referenced by dig_load_plus().
int dig_alloc_cats | ( | struct line_cats * | cats, |
int | num | ||
) |
Allocate room for 'num' fields and category arrays in struct line_cats.
cats | pointer to line_cats struct |
num | number of cats |
Definition at line 380 of file struct_alloc.c.
References line_cats::alloc_cats, line_cats::cat, dig__alloc_space(), dig_out_of_memory(), and line_cats::field.
Referenced by Vect_cat_set().
struct P_isle* dig_alloc_isle | ( | void | ) |
Allocate new isle structure.
Definition at line 301 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_Rd_P_isle().
int dig_alloc_isles | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to isles.
Plus | pointer to Plus_head structure |
add | space for 'add' number of isles is added. |
Definition at line 243 of file struct_alloc.c.
Referenced by dig_load_plus().
struct P_line* dig_alloc_line | ( | void | ) |
Allocate new line structure.
Definition at line 127 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_Rd_P_line().
int dig_alloc_lines | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to lines.
Plus | pointer to Plus_head structure |
add | space for 'add' number of lines is added. |
Definition at line 193 of file struct_alloc.c.
Referenced by dig_load_plus(), and Vect__load_map_lines_pg().
struct P_node* dig_alloc_node | ( | void | ) |
Allocate new node structure.
Definition at line 30 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_add_node(), and dig_Rd_P_node().
int dig_alloc_nodes | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to nodes.
Plus | pointer to Plus_head structure |
add | number of nodes to be added |
Definition at line 105 of file struct_alloc.c.
Referenced by dig_add_node(), dig_load_plus(), and Vect__load_map_nodes_pg().
int dig_alloc_points | ( | struct line_pnts * | points, |
int | num | ||
) |
allocate room for 'num' X and Y arrays in struct line_pnts
points | pointer to line_pnts struct |
num | number of points |
Definition at line 336 of file struct_alloc.c.
References line_pnts::alloc_points, dig__alloc_space(), dig_out_of_memory(), line_pnts::x, line_pnts::y, and line_pnts::z.
void* dig_alloc_topo | ( | char | type | ) |
Allocate new topo struct.
type | to of struct to allocate |
Definition at line 145 of file struct_alloc.c.
Referenced by dig_Rd_P_line().
int dig_area_alloc_isle | ( | struct P_area * | area, |
int | add | ||
) |
Allocate space in P_area for add new isles.
area | pointer to P_area struct |
add | number of isle to be added |
Definition at line 440 of file struct_alloc.c.
Referenced by dig_Rd_P_area().
int dig_area_alloc_line | ( | struct P_area * | area, |
int | add | ||
) |
allocate space in P_area for add new lines
area | pointer to P_area struct |
add | number of lines to be added |
Definition at line 414 of file struct_alloc.c.
Referenced by dig_Rd_P_area().
void dig_free_area | ( | struct P_area * | Area | ) |
Free area structure.
Area | pointer to P_area struct to be freed |
Definition at line 284 of file struct_alloc.c.
References P_area::alloc_isles, P_area::alloc_lines, free(), G_free(), P_area::isles, and P_area::lines.
Referenced by dig_free_plus_areas(), and dig_Rd_P_area().
void dig_free_isle | ( | struct P_isle * | Isle | ) |
Free isle structure.
Isle | pointer to P_isle struct to be freed |
Definition at line 319 of file struct_alloc.c.
References P_isle::alloc_lines, G_free(), and P_isle::lines.
Referenced by dig_free_plus_isles(), and dig_Rd_P_isle().
void dig_free_line | ( | struct P_line * | Line | ) |
Free line structure.
pointer | to P_line struct to be freed |
Definition at line 177 of file struct_alloc.c.
References G_free(), and P_line::topo.
Referenced by dig_free_plus_lines(), and dig_Rd_P_line().
void dig_free_node | ( | struct P_node * | Node | ) |
Free node structure.
Node | pointer to P_node struct to be freed |
Definition at line 48 of file struct_alloc.c.
References P_node::alloc_lines, P_node::angles, G_free(), and P_node::lines.
Referenced by dig_free_plus_nodes(), and dig_Rd_P_node().
int dig_isle_alloc_line | ( | struct P_isle * | isle, |
int | add | ||
) |
Allocate space in P_isle for add new lines.
isle | pointer to P_area struct |
add | number of isle to be added |
Definition at line 466 of file struct_alloc.c.
Referenced by dig_Rd_P_isle().
int dig_node_alloc_line | ( | struct P_node * | node, |
int | add | ||
) |
Allocate space in P_node struct.
Lines and angles arrays to add 'add' more lines
node | pointer to P_node struct |
add | number lines to be added |
Definition at line 69 of file struct_alloc.c.
Referenced by dig_Rd_P_node().
int dig_out_of_memory | ( | void | ) |
For now just print message and return error code.
Definition at line 487 of file struct_alloc.c.
References _, and G_warning().
Referenced by dig_alloc_cats(), and dig_alloc_points().