LD_LinkedList.h
//Given a data pointer of a node, this functions starts deleting secuent nodes
//If a function is given, it is executed for each node data section.
Given a data pointer of a node, this functions starts deleting secuent nodes
If a function is given, it is executed for each node data section.
Given a data pointer of a node this functions starts deleting secuent nodes If a function is given it is executed for each node data section .
void _LinkedList_remove_continuous(void * Node, void (*Erasing_Function) (void *), void * List_ptr,uintptr_t Data_Offset,uintptr_t Next_Offset)
{
    uintptr_t * _Node_ = ((uintptr_t*)Node) - Data_Offset;
    void * tmp;   
    uintptr_t Count =0;
    if(Erasing_Function==NULL)
    {
	while(_Node_!=NULL)
	{
	    tmp = (void*) _Node_[Data_Offset-Next_Offset]; 
	    free(_Node_);
	    _Node_=tmp;
	    Count++;
	}
    }
    else
    {
	while(_Node_!=NULL)
	{
	    tmp = (void*) _Node_[Data_Offset-Next_Offset]; 
	    Erasing_Function(((uintptr_t*)_Node_)+Data_Offset); 
	    free(_Node_);
	    _Node_=tmp;
	    Count++;
	}
    }
    if(List_ptr != NULL){
	(__gllptr(List_ptr)->length)-=Count;
	if(__gllptr(List_ptr)->First == (((uintptr_t*)Node) - Data_Offset))
	{__gllptr(List_ptr)->First=NULL;}
    }
}
void _LinkedList_remove_continuous ( void * Node , void ( * Erasing_Function ) ( void * ) , void * List_ptr , uintptr_t Data_Offset , uintptr_t Next_Offset ) { uintptr_t * _Node_ = ( ( uintptr_t * ) Node ) - Data_Offset ; void * tmp ; uintptr_t Count = 0 ; if ( Erasing_Function == NULL ) { while ( _Node_ != NULL ) { tmp = ( void * ) _Node_ [ Data_Offset - Next_Offset ] ; free ( _Node_ ) ; _Node_ = tmp ; Count ++ ; } } else { while ( _Node_ != NULL ) { tmp = ( void * ) _Node_ [ Data_Offset - Next_Offset ] ; Erasing_Function ( ( ( uintptr_t * ) _Node_ ) + Data_Offset ) ; free ( _Node_ ) ; _Node_ = tmp ; Count ++ ; } } if ( List_ptr != NULL ) { ( __gllptr ( List_ptr ) -> length ) -= Count ; if ( __gllptr ( List_ptr ) -> First == ( ( ( uintptr_t * ) Node ) - Data_Offset ) ) { __gllptr ( List_ptr ) -> First = NULL ; } } }
Given a data pointer of a node, this functions starts deleting secuent nodes
If a function is given, it is executed for each node data section.
Given a data pointer of a node this functions starts deleting secuent nodes If a function is given it is executed for each node data section .
//It go backwards sizeof(uintptr_t)*Data_Offset bytes to get the memory OFFSET of the node //This way the comparing instruction can be avoided inside the loop.  //<- Getting the NEXT //<- Getting the NEXT //<- Sending the Data section