72 if (
list->alloc_values) {
97 for (i = 0; i <
list->n_values; i++) {
98 if (val ==
list->value[i])
102 if (
list->n_values ==
list->alloc_values) {
103 size = (
list->n_values + 1000) *
sizeof(
int);
105 list->alloc_values =
list->n_values + 1000;
130 for (i = 0; i < blist->
n_values; i++)
152 for (i = 0; i <
list->n_values; i++) {
153 if (val ==
list->value[i]) {
154 for (j = i + 1; j <
list->n_values; j++)
155 list->value[j - 1] =
list->value[j];
181 for (i = 0; i < blist->
n_values; i++)
203 for (i = 0; i <
list->n_values; i++) {
204 if (val ==
list->value[i])
267 if (
list->alloc_values) {
296 for (i = 0; i <
list->n_values; i++) {
297 if (
id ==
list->id[i])
301 if (
list->n_values ==
list->alloc_values) {
302 size = (
list->n_values + 1000) *
sizeof(
int);
305 if (
list->have_boxes) {
310 list->alloc_values =
list->n_values + 1000;
314 if (
list->have_boxes)
339 for (i = 0; i < blist->
n_values; i++)
345 box.
E = box.
W = box.
N = box.
S = box.
T = box.
B = 0;
346 for (i = 0; i < blist->
n_values; i++)
369 for (i = 0; i <
list->n_values; i++) {
370 if (
id ==
list->id[i]) {
371 for (j = i + 1; j <
list->n_values; j++) {
373 if (
list->have_boxes)
402 for (i = 0; i < blist->
n_values; i++)
424 for (i = 0; i <
list->n_values; i++) {
425 if (
id ==
list->id[i])
void G_free(void *)
Free allocated memory.
List of bounding boxes with id.
int alloc_values
Allocated space for items.
struct bound_box * box
Array of bounding boxes.
int n_values
Number of items in the list.
int have_boxes
flag to indicate whether bounding boxes should be added
int n_values
Number of values in the list.
int * value
Array of values.
int alloc_values
Allocated space for values.
void Vect_destroy_list(struct ilist *list)
Frees all memory associated with a struct ilist, including the struct itself.
int Vect_reset_list(struct ilist *list)
Reset ilist structure.
int Vect_val_in_list(const struct ilist *list, int val)
Find a given item in the list.
int Vect_boxlist_delete(struct boxlist *list, int id)
Remove a given value (item) from list.
struct boxlist * Vect_new_boxlist(int have_boxes)
Creates and initializes a struct boxlist.
int Vect_list_delete(struct ilist *list, int val)
Remove a given value (item) from list.
int Vect_list_append_list(struct ilist *alist, const struct ilist *blist)
Append new items to the end of list if not yet present.
void Vect_destroy_boxlist(struct boxlist *list)
Frees all memory associated with a struct boxlist, including the struct itself.
struct ilist * Vect_new_list(void)
Creates and initializes a struct ilist.
int Vect_val_in_boxlist(const struct boxlist *list, int id)
Find a given item in the list.
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.
int Vect_list_delete_list(struct ilist *alist, const struct ilist *blist)
Delete list from existing list.
int Vect_reset_boxlist(struct boxlist *list)
Reset boxlist structure.
int Vect_boxlist_append_boxlist(struct boxlist *alist, const struct boxlist *blist)
Append new items to the end of list if not yet present.
int Vect_boxlist_delete_boxlist(struct boxlist *alist, const struct boxlist *blist)
Delete list from existing list.
int Vect_list_append(struct ilist *list, int val)
Append new item to the end of list if not yet present.