Classes | |
struct | Gan_List_Node |
Doubly-linked list node. More... | |
struct | Gan_List |
Doubly-linked list type. More... | |
Defines | |
#define | TYPE int |
Typedefs | |
typedef Gan_List_Node | Gan_List_Node |
Doubly-linked list node. | |
typedef Gan_List | Gan_List |
Doubly-linked list type. | |
Functions | |
Gan_List * | gan_list_new (void) |
Makes a new singly linked list containing no elements. | |
Gan_List * | gan_list_form (Gan_List *list) |
Forms a new singly linked list containing no elements. | |
Gan_List * | gan_list_new_from_array (void **array, unsigned n) |
Makes a new linked list containing nodes with data from array. | |
void | gan_list_free (Gan_List *list, Gan_FreeFunc free_func) |
Frees the list, nodes and data contained in the list. | |
Gan_Bool | gan_list_insert_first (Gan_List *list, void *data) |
Inserts a new node at the head of the list. | |
Gan_Bool | gan_list_insert_next (Gan_List *list, void *data) |
Inserts a new node in the position following the current one. | |
Gan_Bool | gan_list_insert_prev (Gan_List *list, void *data) |
Inserts a new node in the position before current one. | |
Gan_Bool | gan_list_insert_last (Gan_List *list, void *data) |
Inserts a new node at the tail of the list. | |
Gan_Bool | gan_list_insert_at (Gan_List *list, void *data, int pos) |
Inserts a new node at a specified position (0 = head). | |
Gan_Bool | gan_list_delete_first (Gan_List *list, Gan_FreeFunc free_func) |
Deletes the node at the head of the list. | |
Gan_Bool | gan_list_delete_next (Gan_List *list, Gan_FreeFunc free_func) |
Deletes the node following the current position. | |
Gan_Bool | gan_list_delete_current (Gan_List *list, Gan_FreeFunc free_func) |
Deletes the node in the current position in a linked list. | |
Gan_Bool | gan_list_delete_prev (Gan_List *list, Gan_FreeFunc free_func) |
Deletes the node in the position previous to the current one. | |
Gan_Bool | gan_list_delete_at (Gan_List *list, Gan_FreeFunc free_func, int pos) |
Deletes the node with the specified position (0 = head). | |
Gan_Bool | gan_list_delete_last (Gan_List *list, Gan_FreeFunc free_func) |
Deletes the node at the tail of the list. | |
void | gan_list_delete_all (Gan_List *list, Gan_FreeFunc free_func) |
Deletes all the nodes in the list and frees their data. | |
void | gan_list_goto_head (Gan_List *list) |
Moves the current position to the position before the head. | |
Gan_Bool | gan_list_goto_pos (Gan_List *list, int pos) |
Moves the current position to the specified position. | |
void | gan_list_goto_tail (Gan_List *list) |
Moves the current position to the tail of the list. | |
void * | gan_list_get_prev_node (Gan_List *list) |
Not a user function. | |
void * | gan_list_get_current_node (Gan_List *list) |
Not a user function. | |
void * | gan_list_get_next_node (Gan_List *list) |
Not a user function. | |
void * | gan_list_set_prev (Gan_List *list, void *new_data) |
Sets the previous data pointer, decrements the current position. | |
void * | gan_list_set_current (Gan_List *list, void *new_data) |
Sets the value of the data pointer in the current node. | |
void * | gan_list_set_next (Gan_List *list, void *new_data) |
Sets the next data pointer, increments the current position. | |
void | gan_list_push_current (Gan_List *list) |
Pushes the current position of the data pointer onto the stack. | |
void | gan_list_pop_current (Gan_List *list) |
Pops the current position of the data pointer from the stack. | |
int | gan_list_get_pos (Gan_List *list) |
Returns the current position in the list. | |
int | gan_list_get_size (Gan_List *list) |
Returns the current number of nodes in the list. | |
void | gan_list_process_data (Gan_List *list, void(*process_func)(void *, void *), void *data) |
Processes all elements in the list. | |
Gan_List * | gan_list_concat (Gan_List *list1, Gan_List *list2) |
Concatanates two lists, creating a new list. | |
void | gan_list_reverse (Gan_List *list) |
Reverses the order of the elements in the list. | |
int | gan_list_to_array (Gan_List *list, void ***array_ptr) |
Creates an array of pointers to the objects in a list. | |
Gan_List * | gan_list_copy (Gan_List *list) |
Copies all the nodes of a list, creating a new list. | |
Gan_List * | gan_list_copy_with_data (Gan_List *list, Gan_CopyFunc copy_func) |
Copies all the nodes of a list, creating a new list. | |
void | gan_list_sort_asc (Gan_List *list, int(*compare)(const void *, const void *)) |
Sorts the nodes in the list in ascending order. | |
void | gan_list_make_straight (Gan_List *list) |
Makes a doubly linked list behave like a straight linked list. | |
void | gan_list_make_circular (Gan_List *list) |
Makes a doubly linked list behave like a circular linked list. | |
Gan_Bool | gan_list_is_circular (Gan_List *list) |
Returns GAN_TRUE is the doubly linked list is circular. | |
Gan_Bool | gan_list_contains (Gan_List *list, void *data) |
Returns GAN_TRUE is the doubly linked list contains 'data'. | |
TYPE * | gan_list_get_prev (Gan_List *list, TYPE node_type) |
Returns previous data pointer, decrements the current position. | |
TYPE * | gan_list_get_current (Gan_List *list, TYPE node_type) |
Returns the data pointed to by the current node. | |
TYPE * | gan_list_get_next (Gan_List *list, TYPE node_type) |
Macro: Returns the next data pointer, increments the current position. |
|
Concatanates two lists, creating a new list.
|
|
Returns GAN_TRUE is the doubly linked list contains 'data'.
|
|
Copies all the nodes of a list, creating a new list.
|
|
Copies all the nodes of a list, creating a new list.
|
|
Deletes all the nodes in the list and frees their data.
|
|
Deletes the node with the specified position (0 = head).
NULL for free_func if data pointed to by the node should not to be freed. |
|
Deletes the node in the current position in a linked list.
|
|
Deletes the node at the head of the list.
NULL if data pointed to by the node should not to be freed |
|
Deletes the node at the tail of the list.
NULL if data pointed to by the node should not to be freed. |
|
Deletes the node following the current position.
NULL as the free_func if data pointed to by the node should not to be freed. |
|
Deletes the node in the position previous to the current one.
|
|
Forms a new singly linked list containing no elements.
|
|
Frees the list, nodes and data contained in the list.
NULL for free_func if data pointed to by the node should not to be freed. |
|
Returns the data pointed to by the current node.
int . |
|
Not a user function. Use the gan_list_get_current() macro instead. |
|
Macro: Returns the next data pointer, increments the current position.
int . |
|
Not a user function. Use the gan_list_get_next() macro instead. |
|
Returns the current position in the list.
|
|
Returns previous data pointer, decrements the current position.
int . |
|
Not a user function. Use the gan_list_get_prev() macro instead. |
|
Returns the current number of nodes in the list.
|
|
Moves the current position to the position before the head.
|
|
Moves the current position to the specified position.
|
|
Moves the current position to the tail of the list.
|
|
Inserts a new node at a specified position (0 = head).
|
|
Inserts a new node at the head of the list.
|
|
Inserts a new node at the tail of the list.
|
|
Inserts a new node in the position following the current one.
|
|
Inserts a new node in the position before current one.
|
|
Returns GAN_TRUE is the doubly linked list is circular.
|
|
Makes a doubly linked list behave like a circular linked list.
|
|
Makes a doubly linked list behave like a straight linked list.
|
|
Makes a new singly linked list containing no elements.
|
|
Makes a new linked list containing nodes with data from array.
|
|
Pops the current position of the data pointer from the stack.
|
|
Processes all elements in the list.
|
|
Pushes the current position of the data pointer onto the stack.
|
|
Reverses the order of the elements in the list.
|
|
Sets the value of the data pointer in the current node.
|
|
Sets the next data pointer, increments the current position.
|
|
Sets the previous data pointer, decrements the current position.
|
|
Sorts the nodes in the list in ascending order.
qsort() . |
|
Creates an array of pointers to the objects in a list.
|