GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-602118adcc
|
Vector library - list definition. More...
Go to the source code of this file.
Functions | |
struct ilist * | Vect_new_list (void) |
Creates and initializes a struct ilist. More... | |
int | Vect_reset_list (struct ilist *list) |
Reset ilist structure. More... | |
void | Vect_destroy_list (struct ilist *list) |
Frees all memory associated with a struct ilist, including the struct itself. More... | |
int | Vect_list_append (struct ilist *list, int val) |
Append new item to the end of list if not yet present. More... | |
int | Vect_list_append_list (struct ilist *alist, const struct ilist *blist) |
Append new items to the end of list if not yet present. More... | |
int | Vect_list_delete (struct ilist *list, int val) |
Remove a given value (item) from list. More... | |
int | Vect_list_delete_list (struct ilist *alist, const struct ilist *blist) |
Delete list from existing list. More... | |
int | Vect_val_in_list (const struct ilist *list, int val) |
Find a given item in the list. More... | |
struct boxlist * | Vect_new_boxlist (int have_boxes) |
Creates and initializes a struct boxlist. More... | |
int | Vect_reset_boxlist (struct boxlist *list) |
Reset boxlist structure. More... | |
void | Vect_destroy_boxlist (struct boxlist *list) |
Frees all memory associated with a struct boxlist, including the struct itself. More... | |
int | Vect_boxlist_append (struct boxlist *list, int id, const struct bound_box *box) |
Append new item to the end of list if not yet present. More... | |
int | Vect_boxlist_append_boxlist (struct boxlist *alist, const struct boxlist *blist) |
Append new items to the end of list if not yet present. More... | |
int | Vect_boxlist_delete (struct boxlist *list, int id) |
Remove a given value (item) from list. More... | |
int | Vect_boxlist_delete_boxlist (struct boxlist *alist, const struct boxlist *blist) |
Delete list from existing list. More... | |
int | Vect_val_in_boxlist (const struct boxlist *list, int id) |
Find a given item in the list. More... | |
Vector library - list definition.
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2009 by the GRASS Development Team
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 vector/Vlib/list.c.
Append new item to the end of list if not yet present.
[in,out] | list | pointer to ilist structure |
id | new item to append to the end of list | |
box | bounding box |
Definition at line 287 of file vector/Vlib/list.c.
References G_realloc, and NULL.
Referenced by Vect_boxlist_append_boxlist().
Append new items to the end of list if not yet present.
[in,out] | alist | pointer to boxlist structure where items will be appended |
blist | pointer to boxlist structure with new items |
Definition at line 330 of file vector/Vlib/list.c.
References bound_box::B, boxlist::box, bound_box::E, boxlist::have_boxes, boxlist::id, bound_box::N, boxlist::n_values, NULL, bound_box::S, bound_box::T, Vect_boxlist_append(), and bound_box::W.
int Vect_boxlist_delete | ( | struct boxlist * | list, |
int | id | ||
) |
Remove a given value (item) from list.
[in,out] | list | pointer to boxlist structure |
id | to remove |
Definition at line 362 of file vector/Vlib/list.c.
References NULL.
Referenced by Vect_boxlist_delete_boxlist().
Delete list from existing list.
[in,out] | alist | pointer to original boxlist structure, |
blist | pointer to boxlist structure with items to delete |
Definition at line 394 of file vector/Vlib/list.c.
References boxlist::id, boxlist::n_values, NULL, and Vect_boxlist_delete().
void Vect_destroy_boxlist | ( | struct boxlist * | list | ) |
Frees all memory associated with a struct boxlist, including the struct itself.
[in,out] | list | pointer to ilist structure |
Definition at line 264 of file vector/Vlib/list.c.
void Vect_destroy_list | ( | struct ilist * | list | ) |
Frees all memory associated with a struct ilist, including the struct itself.
[in,out] | list | pointer to ilist structure |
Definition at line 69 of file vector/Vlib/list.c.
int Vect_list_append | ( | struct ilist * | list, |
int | val | ||
) |
Append new item to the end of list if not yet present.
[in,out] | list | pointer to ilist structure |
val | new item to append to the end of list |
Definition at line 89 of file vector/Vlib/list.c.
References G_realloc, and NULL.
Referenced by Vect_field_cat_get(), and Vect_list_append_list().
Append new items to the end of list if not yet present.
[in,out] | alist | pointer to ilist structure where items will be appended |
blist | pointer to ilist structure with new items |
Definition at line 123 of file vector/Vlib/list.c.
References ilist::n_values, NULL, ilist::value, and Vect_list_append().
int Vect_list_delete | ( | struct ilist * | list, |
int | val | ||
) |
Remove a given value (item) from list.
[in,out] | list | pointer to ilist structure |
val | to remove |
Definition at line 145 of file vector/Vlib/list.c.
References NULL.
Referenced by Vect_list_delete_list().
Delete list from existing list.
[in,out] | alist | pointer to original ilist structure, |
blist | pointer to ilist structure with items to delete |
Definition at line 174 of file vector/Vlib/list.c.
References ilist::n_values, NULL, ilist::value, and Vect_list_delete().
struct boxlist* Vect_new_boxlist | ( | int | have_boxes | ) |
Creates and initializes a struct boxlist.
This structure is used as container for bounding boxes with id. The library routines handle all memory allocation.
have_boxes | if set to 0, the list will hold only ids and no boxes |
Definition at line 224 of file vector/Vlib/list.c.
References boxlist::alloc_values, boxlist::box, G_malloc, boxlist::have_boxes, boxlist::id, boxlist::n_values, and NULL.
Referenced by Vect_attach_isles(), and Vect_find_area().
struct ilist* Vect_new_list | ( | void | ) |
Creates and initializes a struct ilist.
This structure is used as container for integer values. The library routines handle all memory allocation.
Definition at line 31 of file vector/Vlib/list.c.
References ilist::alloc_values, G_malloc, ilist::n_values, NULL, and ilist::value.
Referenced by NetA_betweenness_closeness(), Vect_find_node(), Vect_select_areas_by_polygon(), and Vedit_extend_lines().
int Vect_reset_boxlist | ( | struct boxlist * | list | ) |
Reset boxlist structure.
To make sure boxlist structure is clean to be re-used. List must have previously been created with Vect_new_boxlist().
[in,out] | list | pointer to struct boxlist |
Definition at line 251 of file vector/Vlib/list.c.
int Vect_reset_list | ( | struct ilist * | list | ) |
Reset ilist structure.
To make sure ilist structure is clean to be re-used. List must have previously been created with Vect_new_list().
[in,out] | list | pointer to struct ilist |
Definition at line 56 of file vector/Vlib/list.c.
Referenced by Vect_field_cat_get(), Vect_select_areas_by_polygon(), Vect_select_nodes_by_box(), and Vect_spatial_index_select().
int Vect_val_in_boxlist | ( | const struct boxlist * | list, |
int | id | ||
) |
Find a given item in the list.
list | pointer to boxlist structure |
id | value of item |
Definition at line 417 of file vector/Vlib/list.c.
References NULL.
int Vect_val_in_list | ( | const struct ilist * | list, |
int | val | ||
) |
Find a given item in the list.
list | pointer to ilist structure |
val | value of item |
Definition at line 196 of file vector/Vlib/list.c.
References NULL.