axlPointer axl_list_lookup ( axlList list,
axlLookupFunc  func,
axlPointer  data 
)

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.

Parameters:
list The list where the lookup will be performed.
func The function to use to perform the lookup.
data User defined data that will be passed to the func provided.
Returns:
A pointer to the object found or NULL if no item was found.