| typedef struct apr_skiplist apr_skiplist |
Opaque structure used to represent the skip list
| typedef int(*) apr_skiplist_compare(void *, void *) |
apr_skiplist_compare is the function type that must be implemented per object type that is used in a skip list for comparisons to maintain order
| typedef void(*) apr_skiplist_freefunc(void *) |
apr_skiplist_freefunc is the function type that must be implemented to handle elements as they are removed from a skip list.
| typedef struct apr_skiplistnode apr_skiplistnode |
Opaque structure
| apr_skiplistnode* apr_skiplist_add | ( | apr_skiplist * | sl, | |
| void * | data | |||
| ) |
Add an element into the skip list using the existing comparison function allowing for duplicates.
| sl | The skip list | |
| data | The element to insert |
| apr_skiplistnode* apr_skiplist_add_compare | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplist_compare | comp | |||
| ) |
Add an element into the skip list using the specified comparison function allowing for duplicates.
| sl | The skip list | |
| data | The element to add | |
| comp | The comparison function to use for placement into the skip list |
| void apr_skiplist_add_index | ( | apr_skiplist * | sl, | |
| apr_skiplist_compare | XXX1, | |||
| apr_skiplist_compare | XXX2 | |||
| ) |
Set the indexing functions to the specified comparison functions and rebuild the index.
| sl | The skip list | |
| XXX1 | FIXME | |
| XXX2 | FIXME |
| void* apr_skiplist_alloc | ( | apr_skiplist * | sl, | |
| size_t | size | |||
| ) |
Allocate memory using the same mechanism as the skip list.
| sl | The skip list | |
| size | The amount to allocate |
| void apr_skiplist_destroy | ( | apr_skiplist * | sl, | |
| apr_skiplist_freefunc | myfree | |||
| ) |
Remove each element from the skip list.
| sl | The skip list | |
| myfree | A function to be called for each removed element |
| void* apr_skiplist_element | ( | apr_skiplistnode * | iter | ) |
Return the element of the skip list node
| iter | The skip list node |
| void* apr_skiplist_find | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplistnode ** | iter | |||
| ) |
Return the next matching element in the skip list using the current comparison function.
| sl | The skip list | |
| data | The value to search for | |
| iter | A pointer to the returned skip list node representing the element found |
| void* apr_skiplist_find_compare | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplistnode ** | iter, | |||
| apr_skiplist_compare | func | |||
| ) |
Return the next matching element in the skip list using the specified comparison function.
| sl | The skip list | |
| data | The value to search for | |
| iter | A pointer to the returned skip list node representing the element found | |
| func | The comparison function to use |
| void apr_skiplist_free | ( | apr_skiplist * | sl, | |
| void * | mem | |||
| ) |
Free memory using the same mechanism as the skip list.
| sl | The skip list | |
| mem | The object to free |
| apr_skiplistnode* apr_skiplist_getlist | ( | apr_skiplist * | sl | ) |
Return the list maintained by the skip list abstraction.
| sl | The skip list |
| int apr_skiplist_height | ( | const apr_skiplist * | sl | ) |
Return the height of the list (number of skip paths), in O(1).
| sl | The skip list |
| apr_status_t apr_skiplist_init | ( | apr_skiplist ** | sl, | |
| apr_pool_t * | p | |||
| ) |
Allocate a new skip list
| sl | The pointer in which to return the newly created skip list | |
| p | The pool from which to allocate the skip list (optional). |
| apr_skiplistnode* apr_skiplist_insert | ( | apr_skiplist * | sl, | |
| void * | data | |||
| ) |
Insert an element into the skip list using the existing comparison function if it does not already exist.
| sl | The skip list | |
| data | The element to insert |
| apr_skiplistnode* apr_skiplist_insert_compare | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplist_compare | comp | |||
| ) |
Insert an element into the skip list using the specified comparison function if it does not already exist.
| sl | The skip list | |
| data | The element to insert | |
| comp | The comparison function to use for placement into the skip list |
| void* apr_skiplist_last | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplistnode ** | iter | |||
| ) |
Return the last matching element in the skip list using the current comparison function.
| sl | The skip list | |
| data | The value to search for | |
| iter | A pointer to the returned skip list node representing the element found |
| void* apr_skiplist_last_compare | ( | apr_skiplist * | sli, | |
| void * | data, | |||
| apr_skiplistnode ** | iter, | |||
| apr_skiplist_compare | comp | |||
| ) |
Return the last matching element in the skip list using the specified comparison function.
| sl | The skip list | |
| data | The value to search for | |
| iter | A pointer to the returned skip list node representing the element found | |
| func | The comparison function to use |
| apr_skiplist* apr_skiplist_merge | ( | apr_skiplist * | sl1, | |
| apr_skiplist * | sl2 | |||
| ) |
Merge two skip lists. XXX SEMANTICS
| sl1 | One of two skip lists to be merged | |
| sl2 | The other of two skip lists to be merged |
| void* apr_skiplist_next | ( | apr_skiplist * | sl, | |
| apr_skiplistnode ** | iter | |||
| ) |
Return the next element in the skip list.
| sl | The skip list | |
| iter | On entry, a pointer to the skip list node to start with; on return, a pointer to the skip list node representing the element returned |
| void* apr_skiplist_peek | ( | apr_skiplist * | sl | ) |
Return the first element in the skip list, leaving the element in the skip list.
| sl | The skip list |
| void* apr_skiplist_pop | ( | apr_skiplist * | sl, | |
| apr_skiplist_freefunc | myfree | |||
| ) |
Return the first element in the skip list, removing the element from the skip list.
| sl | The skip list | |
| myfree | A function to be called for the removed element |
| int apr_skiplist_preheight | ( | const apr_skiplist * | sl | ) |
Return the predefined maximum height of the skip list.
| sl | The skip list |
| void* apr_skiplist_previous | ( | apr_skiplist * | sl, | |
| apr_skiplistnode ** | iter | |||
| ) |
Return the previous element in the skip list.
| sl | The skip list | |
| iter | On entry, a pointer to the skip list node to start with; on return, a pointer to the skip list node representing the element returned |
| int apr_skiplist_remove | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplist_freefunc | myfree | |||
| ) |
Remove an element from the skip list using the existing comparison function for locating the element. In the case of duplicates, the 1st entry will be removed.
| sl | The skip list | |
| data | The element to remove | |
| myfree | A function to be called for each removed element |
If no comparison function has been set for the skip list, the element will not be removed and 0 will be returned.
| void apr_skiplist_remove_all | ( | apr_skiplist * | sl, | |
| apr_skiplist_freefunc | myfree | |||
| ) |
Remove all elements from the skip list.
| sl | The skip list | |
| myfree | A function to be called for each removed element |
| int apr_skiplist_remove_compare | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplist_freefunc | myfree, | |||
| apr_skiplist_compare | comp | |||
| ) |
Remove an element from the skip list using the specified comparison function for locating the element. In the case of duplicates, the 1st entry will be removed.
| sl | The skip list | |
| data | The element to remove | |
| myfree | A function to be called for each removed element | |
| comp | The comparison function to use for placement into the skip list |
| int apr_skiplist_remove_node | ( | apr_skiplist * | sl, | |
| apr_skiplistnode * | iter, | |||
| apr_skiplist_freefunc | myfree | |||
| ) |
Remove a node from the skip list.
| sl | The skip list | |
| iter | The skip list node to remove | |
| myfree | A function to be called for the removed element |
| apr_skiplistnode* apr_skiplist_replace | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplist_freefunc | myfree | |||
| ) |
Add an element into the skip list using the existing comparison function removing the existing duplicates.
| sl | The skip list | |
| data | The element to insert | |
| myfree | A function to be called for each removed duplicate |
| apr_skiplistnode* apr_skiplist_replace_compare | ( | apr_skiplist * | sl, | |
| void * | data, | |||
| apr_skiplist_freefunc | myfree, | |||
| apr_skiplist_compare | comp | |||
| ) |
Add an element into the skip list using the specified comparison function removing the existing duplicates.
| sl | The skip list | |
| data | The element to insert | |
| comp | The comparison function to use for placement into the skip list | |
| myfree | A function to be called for each removed duplicate |
| void apr_skiplist_set_compare | ( | apr_skiplist * | sl, | |
| apr_skiplist_compare | XXX1, | |||
| apr_skiplist_compare | XXX2 | |||
| ) |
Set the comparison functions to be used for searching the skip list.
| sl | The skip list | |
| XXX1 | FIXME | |
| XXX2 | FIXME |
| void apr_skiplist_set_preheight | ( | apr_skiplist * | sl, | |
| int | to | |||
| ) |
Set a predefined maximum height for the skip list.
| sl | The skip list | |
| to | The preheight to set, or a nul/negative value to disable. |
| size_t apr_skiplist_size | ( | const apr_skiplist * | sl | ) |
Return the size of the list (number of elements), in O(1).
| sl | The skip list |
1.5.0