Functions

Vlib/list.c File Reference

#include <stdlib.h>
#include <grass/Vect.h>
#include <grass/gis.h>
Include dependency graph for Vlib/list.c:

Go to the source code of this file.

Functions

struct ilist * Vect_new_list (void)
 Creates and initializes a struct ilist.
int Vect_reset_list (struct ilist *list)
 Reset ilist structure.
int Vect_destroy_list (struct ilist *list)
 Frees all memory associated with a struct ilist, including the struct itself.
int Vect_list_append (struct ilist *list, int val)
 Append new item to the end of list if not yet present.
int Vect_list_append_list (struct ilist *alist, struct ilist *blist)
 Append new items to the end of list if not yet present.
int Vect_list_delete (struct ilist *list, int val)
 Remove a given value (item) from list.
int Vect_list_delete_list (struct ilist *alist, struct ilist *blist)
 Delete list from existing list.
int Vect_val_in_list (struct ilist *list, int val)
 Find a given item in the list.

Function Documentation

int Vect_destroy_list ( struct ilist *  list  ) 

Frees all memory associated with a struct ilist, including the struct itself.

Parameters:
[in,out] list pointer to ilist structure
Returns:
0

Definition at line 74 of file Vlib/list.c.

Referenced by Vect_break_lines_list(), Vect_find_line(), Vect_find_line_list(), Vect_snap_lines(), Vedit_connect_lines(), Vedit_select_by_query(), and Vedit_split_lines().

int Vect_list_append ( struct ilist *  list,
int  val 
)

Append new item to the end of list if not yet present.

Parameters:
[in,out] list pointer to ilist structure
[in] val new item to append to the end of list
Returns:
0 on success
1 on error

Definition at line 96 of file Vlib/list.c.

Referenced by Vect_break_lines_list(), Vect_cidx_find_all(), Vect_field_cat_get(), Vect_find_line(), Vect_find_line_list(), Vect_get_area_boundaries(), Vect_get_isle_boundaries(), Vect_graph_shortest_path(), Vect_list_append_list(), Vect_net_shortest_path(), Vect_net_shortest_path_coor(), Vect_overlay_and(), Vect_remove_small_areas(), Vect_snap_lines(), Vedit_connect_lines(), Vedit_merge_lines(), Vedit_select_by_query(), and Vedit_split_lines().

int Vect_list_append_list ( struct ilist *  alist,
struct ilist *  blist 
)

Append new items to the end of list if not yet present.

Parameters:
[in,out] alist pointer to ilist structure where items will be appended
[in] blist pointer to ilist structure with new items
Returns:
0 on success
1 on error

Definition at line 130 of file Vlib/list.c.

References Vect_list_append().

int Vect_list_delete ( struct ilist *  list,
int  val 
)

Remove a given value (item) from list.

Parameters:
[in,out] list pointer to ilist structure
[in] val to remove
Returns:
0 on success
1 on error

Definition at line 152 of file Vlib/list.c.

Referenced by Vect_list_delete_list().

int Vect_list_delete_list ( struct ilist *  alist,
struct ilist *  blist 
)

Delete list from existing list.

Parameters:
[in,out] alist pointer to original ilist structure,
[in] blist pointer to ilist structure with items to delete
Returns:
0 on success
1 on error

Definition at line 181 of file Vlib/list.c.

References Vect_list_delete().

struct ilist* Vect_new_list ( void   )  [read]
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().

Parameters:
[in,out] list pointer to struct ilist
Returns:
0

Definition at line 59 of file Vlib/list.c.

Referenced by Vect_cidx_find_all(), Vect_field_cat_get(), Vect_find_line_list(), Vect_get_area_boundaries(), Vect_get_isle_boundaries(), Vect_graph_shortest_path(), Vect_net_shortest_path(), Vect_remove_small_areas(), Vect_snap_lines_list(), Vedit_connect_lines(), and Vedit_merge_lines().

int Vect_val_in_list ( struct ilist *  list,
int  val 
)

Find a given item in the list.

Parameters:
[in] list pointer to ilist structure
[in] val value of item
Returns:
1 if an item is found
0 no found item in the list

Definition at line 203 of file Vlib/list.c.

Referenced by Vect_break_lines_list(), Vect_find_line_list(), Vect_overlay_and(), Vedit_merge_lines(), and Vedit_select_by_query().