Allows to perform a linear lookup on the list provided, givin a function that is used to now the object to return due to the lookup. The function can also be used as a foreach function. The following example shows how to launch the function and perform a tasks on the lookup function: // perform the lookup return axl_list_lookup (list, __find_item, name); // the lookup function bool __find_item (axlPointer _element, axlPointer data) { SomeItem * element = _element; char * name = data; // check the name if (axl_cmp (element->name, name)) return true; // it is not the element return false; } In the case you create a list to hold string values, you can use axl_list_find_string as lookup function predefined to perform the search.
|