![]() |
Flowgrind
Advanced TCP traffic generator
|
Generic doubly linked list implementation. More...
Go to the source code of this file.
Data Structures | |
struct | linked_list |
A doubly linked list. More... | |
struct | list_node |
Single element in a doubly linked list. More... | |
Functions | |
const struct list_node * | fg_list_back (struct linked_list *const list) |
Returns the last element of the list. More... | |
int | fg_list_clear (struct linked_list *const list) |
Removes and destroys all elements from the list, leaving it with a size of 0. More... | |
const struct list_node * | fg_list_front (struct linked_list *const list) |
Returns the first element of the list. More... | |
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. More... | |
void * | fg_list_pop_back (struct linked_list *const list) |
Removes the last element in the list, effectively reducing its size by one. More... | |
void * | fg_list_pop_front (struct linked_list *const list) |
Removes the first element in the list, effectively reducing its size by one. More... | |
int | fg_list_push_back (struct linked_list *const list, void *const data) |
Inserts a new element at the end of the list. More... | |
int | fg_list_push_front (struct linked_list *const list, void *const data) |
Inserts a new element at the beginning of the list. More... | |
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 . More... | |
size_t | fg_list_size (struct linked_list *const list) |
Returns the number of elements in the list. More... | |
Generic doubly linked list implementation.
Definition in file fg_list.h.
const struct list_node* fg_list_back | ( | struct linked_list *const | list | ) |
int fg_list_clear | ( | struct linked_list *const | list | ) |
const struct list_node* fg_list_front | ( | struct linked_list *const | list | ) |
int fg_list_init | ( | struct linked_list *const | list | ) |
void* fg_list_pop_back | ( | struct linked_list *const | list | ) |
Removes the last element in the list, effectively reducing its size by one.
This destroys the removed element. The data contained in this element will not be modified.
[in] | list | to operate on |
Definition at line 188 of file fg_list.c.
void* fg_list_pop_front | ( | struct linked_list *const | list | ) |
Removes the first element in the list, effectively reducing its size by one.
This destroys the removed element. The data contained in this element will not be modified.
[in] | list | to operate on |
Definition at line 144 of file fg_list.c.
int fg_list_push_back | ( | struct linked_list *const | list, |
void *const | data | ||
) |
Inserts a new element at the end of the list.
The data of the new element will point to the same memory location as data
. This effectively increases the list's size by one.
[in] | list | to operate on |
[in] | data | of inserted element |
Definition at line 167 of file fg_list.c.
int fg_list_push_front | ( | struct linked_list *const | list, |
void *const | data | ||
) |
Inserts a new element at the beginning of the list.
The data of the new element will point to the same memory location as data
. This effectively increases the list's size by one.
[in] | list | to operate on |
[in] | data | of inserted element |
Definition at line 123 of file fg_list.c.
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
.
It reduces the list size by one. The data contained in this element will not be modified.
[in] | list | to operate on |
[in] | data | of the element to be removed |
Definition at line 65 of file fg_list.c.
size_t fg_list_size | ( | struct linked_list *const | list | ) |