 |
Flowgrind
Advanced TCP traffic generator
|
Go to the documentation of this file.
80 if (list->
head == node)
82 if (list->
tail == node)
134 list->
tail = new_node;
138 list->
head = new_node;
178 list->
head = new_node;
182 list->
tail = new_node;
size_t fg_list_size(struct linked_list *const list)
Returns the number of elements in the list.
static struct list_node * create_node(void *const data, struct list_node *const previous, struct list_node *const next)
Creates a new list element on the heap.
int fg_list_remove(struct linked_list *const list, const void *const data)
Removes from the list the first element whose data points to data.
void * data
Pointer to user defined data stored with this node.
int fg_list_clear(struct linked_list *const list)
Removes and destroys all elements from the list, leaving it with a size of 0.
struct list_node * previous
Pointer to the next node in the list.
struct list_node * head
Pointer to the first element in the list.
Generic doubly linked list implementation.
size_t size
Size of the list i.e.
int fg_list_push_back(struct linked_list *const list, void *const data)
Inserts a new element at the end of the list.
void * fg_list_pop_front(struct linked_list *const list)
Removes the first element in the list, effectively reducing its size by one.
struct list_node * tail
Pointer to the last element in the list.
Single element in a doubly linked list.
struct list_node * next
Pointer to the previous node in the list.
const struct list_node * fg_list_back(struct linked_list *const list)
Returns the last element of the list.
int fg_list_push_front(struct linked_list *const list, void *const data)
Inserts a new element at the beginning of the list.
int fg_list_init(struct linked_list *const list)
Initializes the list by setting its head and tail to NULL and its size to 0.
const struct list_node * fg_list_front(struct linked_list *const list)
Returns the first element of the list.
void * fg_list_pop_back(struct linked_list *const list)
Removes the last element in the list, effectively reducing its size by one.