evolve4src/src/evolve_simulator/phascii.cpp
static DLIST *dlist_search(DLIST *head, void *p, int (*comp)(void*, void*))
{
	DLIST *curr;

	if( comp ) {
		for(curr=head; curr; curr=curr->next)
			if( (*comp)(p,curr->p) == 0 )
				return curr;
	} else {
		for(curr=head; curr; curr=curr->next)
			if(p == curr->p)
				return curr;
	}

	return NULL;

}
/**********************************************************************
 * Search the list for an element. Return the the DLIST pointer
 * to the element found. If the compare function is NULL, then
 * the element whose has the same data pointer as 'p' is
 * returned.
 *
 */
Search the list for an element. Return the the DLIST pointer
to the element found. If the compare function is NULL, then
the element whose has the same data pointer as 'p' is
returned.
Search the list for an element . Return the the DLIST pointer to the element found . If the compare function is NULL then the element whose has the same data pointer as ' p ' is returned .
static DLIST *dlist_search(DLIST *head, void *p, int (*comp)(void*, void*))
{
	DLIST *curr;
	if( comp ) {
		for(curr=head; curr; curr=curr->next)
			if( (*comp)(p,curr->p) == 0 )
				return curr;
	} else {
		for(curr=head; curr; curr=curr->next)
			if(p == curr->p)
				return curr;
	}
	return NULL;
}
static DLIST * dlist_search ( DLIST * head , void * p , int ( * comp ) ( void * , void * ) ) { DLIST * curr ; if ( comp ) { for ( curr = head ; curr ; curr = curr -> next ) if ( ( * comp ) ( p , curr -> p ) == 0 ) return curr ; } else { for ( curr = head ; curr ; curr = curr -> next ) if ( p == curr -> p ) return curr ; } return NULL ; }
Search the list for an element.
Search the list for an element .