|
girara
|
#include <stddef.h>#include <stdbool.h>#include <sys/types.h>#include <glib.h>#include "macros.h"#include "types.h"Go to the source code of this file.
| void girara_list_append | ( | girara_list_t * | list, |
| void * | data ) |
Append an element to the list.
| list | The girara list object |
| data | The element |
| void girara_list_clear | ( | girara_list_t * | list | ) |
Remove all elements from a list.
| list | The girara list object |
| bool girara_list_contains | ( | girara_list_t * | list, |
| void * | data ) |
Checks if the list contains the given element
| list | The girara list object |
| data | The element |
| void * girara_list_find | ( | const girara_list_t * | list, |
| girara_compare_function_t | compare, | ||
| const void * | data ) |
Find an element
| list | The list |
| compare | compare function |
| data | data passed as the second argument to the compare function |
| void girara_list_foreach | ( | girara_list_t * | list, |
| girara_list_callback_t | callback, | ||
| void * | data ) |
Call function for each element in the list.
| list | The list |
| callback | The function to call. |
| data | Passed to the callback as second argument. |
| void girara_list_free | ( | girara_list_t * | list | ) |
Destroy list.
| list | The girara list object |
| girara_list_iterator_t * girara_list_iterator | ( | girara_list_t * | list | ) |
Create an iterator pointing at the start of list.
| list | The girara list object |
| girara_list_iterator_t * girara_list_iterator_copy | ( | girara_list_iterator_t * | iter | ) |
Create an iterator pointing to the same element as iter.
| iter | The girara list iterator to be copied |
| void * girara_list_iterator_data | ( | girara_list_iterator_t * | iter | ) |
Get data from the element pointed to by the iterator.
| iter | The list iterator |
| void girara_list_iterator_free | ( | girara_list_iterator_t * | iter | ) |
Destroy the iterator.
| iter | The list iterator |
| bool girara_list_iterator_has_next | ( | girara_list_iterator_t * | iter | ) |
Check if iterator has next element.
| iter | The list iterator |
| bool girara_list_iterator_has_previous | ( | girara_list_iterator_t * | iter | ) |
Check if iterator has previous element.
| iter | The list iterator |
| bool girara_list_iterator_is_valid | ( | girara_list_iterator_t * | iter | ) |
Check if iterator is valid
| iter | The list iterator |
| girara_list_iterator_t * girara_list_iterator_next | ( | girara_list_iterator_t * | iter | ) |
Move iterator to next element.
| iter | The list iterator |
| girara_list_iterator_t * girara_list_iterator_previous | ( | girara_list_iterator_t * | iter | ) |
Move iterator to previous element.
| iter | The list iterator |
| void girara_list_iterator_remove | ( | girara_list_iterator_t * | iter | ) |
Remove element pointed by the iterator, and updates the iterator to the next element
| iter | The list iterator |
| void girara_list_iterator_set | ( | girara_list_iterator_t * | iter, |
| void * | data ) |
Set data from the element pointed to by the iterator.
| iter | The list iterator |
| data | Sets the list iterator to a specific element |
| girara_list_t * girara_list_merge | ( | girara_list_t * | list, |
| girara_list_t * | other ) |
Merge a list into another one. Both lists need to have the same free function. If other has a source free function set it will be set to NULL as the elements then belong to list.
| list | the target list |
| other | the source list |
| girara_list_t * girara_list_new | ( | void | ) |
Create a new list.
| girara_list_t * girara_list_new_with_free | ( | girara_free_function_t | gfree | ) |
Create a new list with a free function.
| gfree | Pointer to the free function |
| void * girara_list_nth | ( | girara_list_t * | list, |
| size_t | n ) |
Returns nth entry
| list | The girara list object |
| n | Index of the entry |
| ssize_t girara_list_position | ( | girara_list_t * | list, |
| void * | data ) |
Returns the position of the element in the list
| list | The girara list object |
| data | The element |
| void girara_list_prepend | ( | girara_list_t * | list, |
| void * | data ) |
Prepend an element to the list.
| list | The girara list object |
| data | The element |
| void girara_list_remove | ( | girara_list_t * | list, |
| void * | data ) |
Remove an element of the list
| list | The girara list object |
| data | The element |
| void girara_list_set_free_function | ( | girara_list_t * | list, |
| girara_free_function_t | gfree ) |
Set the function which should be called if the stored data should be freed.
| list | The girara list object |
| gfree | Pointer to the free function |
| void girara_list_set_nth | ( | girara_list_t * | list, |
| size_t | n, | ||
| void * | data ) |
Replaces the nth entry
| list | The girara list object |
| n | Index of the entry |
| data | The new entry |
| size_t girara_list_size | ( | girara_list_t * | list | ) |
Get size of the list.
| list | The girara list object |
| void girara_list_sort | ( | girara_list_t * | list, |
| girara_compare_function_t | compare ) |
Sort a list
| list | The list to sort |
| compare | compare function |
| void girara_node_append | ( | girara_tree_node_t * | parent, |
| girara_tree_node_t * | child ) |
Append a node to another node.
| parent | The parent node |
| child | The child node |
| girara_tree_node_t * girara_node_append_data | ( | girara_tree_node_t * | parent, |
| void * | data ) |
Append data as new node to another node.
| parent | The parent node |
| data | The data of the node |
| void girara_node_free | ( | girara_tree_node_t * | node | ) |
Free a node. This will remove the node from its' parent and will destroy all its' children.
| node | The girara node object |
| girara_list_t * girara_node_get_children | ( | girara_tree_node_t * | node | ) |
Get list of children.
| node | The girara node object |
| void * girara_node_get_data | ( | girara_tree_node_t * | node | ) |
Get data.
| node | The girara node object |
| size_t girara_node_get_num_children | ( | girara_tree_node_t * | node | ) |
Get number of children.
| node | The girara node object |
| girara_tree_node_t * girara_node_get_parent | ( | girara_tree_node_t * | node | ) |
Get parent node.
| node | The girara node object |
| girara_tree_node_t * girara_node_get_root | ( | girara_tree_node_t * | node | ) |
Get root node.
| node | The girara node object |
| girara_tree_node_t * girara_node_new | ( | void * | data | ) |
Create a new node.
| data | Data of the new node |
| void girara_node_set_data | ( | girara_tree_node_t * | node, |
| void * | data ) |
Set data.
| node | The girara node object |
| data | The new data of the object |
| void girara_node_set_free_function | ( | girara_tree_node_t * | node, |
| girara_free_function_t | gfree ) |
Set the function which should be called if the stored data should be freed.
| node | The girara node object |
| gfree | Pointer to the free function |
| girara_list_t * girara_sorted_list_new | ( | girara_compare_function_t | cmp | ) |
Create a new (sorted) list.
| cmp | Pointer to the compare function. |
| girara_list_t * girara_sorted_list_new_with_free | ( | girara_compare_function_t | cmp, |
| girara_free_function_t | gfree ) |
Create a new (sorted) list with a free function.
| cmp | Pointer to the compare function. |
| gfree | Pointer to the free function |