llist.c
void * llist_free(llist *l, int (*f)(void *d, void *u), void *u)
{
	llist_elm *i = l->head, *n;
        void *ff = NULL; 

	while( i ){
	   n = i->next; 	
	   if( f(i->data,u) ) 
 	      ff = i->data;
	   else
	      free(i); 
	   i = n;
	}
	l->head = l->tail = NULL;
	return ff;
}
/* Travel list from head to tail, deallocate each element */
Travel list from head to tail, deallocate each element
Travel list from head to tail deallocate each element
void * llist_free(llist *l, int (*f)(void *d, void *u), void *u)
{
	llist_elm *i = l->head, *n;
        void *ff = NULL; 
	while( i ){
	   n = i->next; 	
	   if( f(i->data,u) ) 
 	      ff = i->data;
	   else
	      free(i); 
	   i = n;
	}
	l->head = l->tail = NULL;
	return ff;
}
void * llist_free ( llist * l , int ( * f ) ( void * d , void * u ) , void * u ) { llist_elm * i = l -> head , * n ; void * ff = NULL ; while ( i ) { n = i -> next ; if ( f ( i -> data , u ) ) ff = i -> data ; else free ( i ) ; i = n ; } l -> head = l -> tail = NULL ; return ff ; }
Travel list from head to tail, deallocate each element
Travel list from head to tail deallocate each element