57 return (list == NULL || !(list->
head));
62 return (list != NULL) ? list->
size : 0;
96 for (
size_t i = 0; i < index; ++i)
99 if (supp == list->
head) {
154 oldElem = list->
head;
156 for (
size_t i = 0; i < index; ++i)
157 oldElem = oldElem->
next;
160 if (oldElem != list->
head) {
162 if (oldElem->
next != NULL) {
193 for (
size_t i = 0; i < index; ++i)
void delete_list_elem_index(List *list, size_t index)
Deletes the DllElem at the indicated index of the List.
void delete_list_elem_bottom(List *list)
Deletes the DllElem at the bottom of the List.
size_t get_list_size(List *list)
Gets the size of the List.
bool is_list_empty(List *list)
Check if the List is empty.
void add_elem_list_bottom(List *list, void *element)
Adds an DllElem to the bottom of the List.
void add_elem_list_index(List *list, void *element, size_t index)
Adds an DllElem at the index indicated of the List.
void del_list(List *list)
Delete an instance of a List.
DllElem * build_dll_elem(void *value, DllElem *next, DllElem *prev)
List * new_list(void)
Create a new instance of a List.
void * get_list_elem_index(List *list, size_t index)
Retrieves a pointer to an DllElem from the List.
The declaration of the functions to manipulate the List.
The double linked List element.
void * value
The value of the element, void pointer to be able to store any type of data.
struct DllElem * prev
The previous element in the List.
struct DllElem * next
The next element in the List.
size_t size
The current size of the List.
DllElem * head
The head of the list as a DllElem.
DllElem * tail
The tail of the list as a DllElem.