parser/src/LinkedListAPI.c
void clearList(List* list) {
    if (list == NULL){
        return;
    }

    if (list->head == NULL && list->tail == NULL){
        return;
    }

    Node* tmp;

    while (list->head != NULL){
        list->deleteData(list->head->data);
        tmp = list->head;
        list->head = list->head->next;
        free(tmp);
    }

    list->head = NULL;
    list->tail = NULL;
    list->length = 0;
}
/** Clears the contents linked list, freeing all memory associated with these contents.  The list itself is not freed.
* uses the supplied function pointer to release allocated memory for the data
*@pre 'List' type must exist and be used in order to keep track of the linked list.
*@post List is empty and list length has been set to 0
*@param list - a pointer to the List struct
**/
Clears the contents linked list, freeing all memory associated with these contents.  The list itself is not freed.
uses the supplied function pointer to release allocated memory for the data
Clears the contents linked list freeing all memory associated with these contents . The list itself is not freed . uses the supplied function pointer to release allocated memory for the data
void clearList(List* list) {
    if (list == NULL){
        return;
    }
    if (list->head == NULL && list->tail == NULL){
        return;
    }
    Node* tmp;
    while (list->head != NULL){
        list->deleteData(list->head->data);
        tmp = list->head;
        list->head = list->head->next;
        free(tmp);
    }
    list->head = NULL;
    list->tail = NULL;
    list->length = 0;
}
void clearList ( List * list ) { if ( list == NULL ) { return ; } if ( list -> head == NULL && list -> tail == NULL ) { return ; } Node * tmp ; while ( list -> head != NULL ) { list -> deleteData ( list -> head -> data ) ; tmp = list -> head ; list -> head = list -> head -> next ; free ( tmp ) ; } list -> head = NULL ; list -> tail = NULL ; list -> length = 0 ; }
Clears the contents linked list, freeing all memory associated with these contents.
Clears the contents linked list freeing all memory associated with these contents .