filter_run
Description:
public List filter_run (
List list,
FilterFunc func,
bool first)
Iterates over the elements in list, calling func with the list item data for each item.
If func returns TRUE, data is prepended to the list of results returned. If first is true, the search
is halted after the first result is found.
Since filter_run knows nothing about the type of data, no reference will be taken (if data
refers to an object) and no copy of data wil be made in any other way when prepending data to the list of results.
Parameters:
| list |
a linked list |
| func |
the function to execute for each item |
| first |
flag to stop execution after a successful item |
| user_data |
user data |
Returns:
| the list of results. Free with g_list_free when no longer needed (the data
contained in the list is a flat copy and does need to be unreferenced or freed). |