library/src/datastructures/BP-LinkedList.cc
// attemts to forward lookup a pointer
attemts to forward lookup a pointer
attemts to forward lookup a pointer
P_BP_LINKL_DATA BP_ForwardLookupDataItemFromPointer(P_BP_LINKL head, void *ptr)
{
	if(!ptr)
		return NULL;
	P_BP_LINKL_DATA first_item = TAILQ_FIRST(&head->head);
	if(!first_item)
		return NULL;
	TAILQ_FOREACH(first_item, &head->head, linkl_data)
	{
		if(first_item->data == ptr)
			return first_item;
	}
	return NULL;
}
P_BP_LINKL_DATA BP_ForwardLookupDataItemFromPointer ( P_BP_LINKL head , void * ptr ) { if ( ! ptr ) return NULL ; P_BP_LINKL_DATA first_item = TAILQ_FIRST ( & head -> head ) ; if ( ! first_item ) return NULL ; TAILQ_FOREACH ( first_item , & head -> head , linkl_data ) { if ( first_item -> data == ptr ) return first_item ; } return NULL ; }
attemts to forward lookup a pointer
attemts to forward lookup a pointer
// attempt to get the first item // ensure we have a first item // looks for a pointer in the item // return no ptr