|
LMMS
|
Macros | |
| #define | ZIX_LOG_FUNC(fmt, arg1) |
| #define | ZIX_UNUSED(name) |
| #define | ZIX_LOG_FUNC(fmt, arg1) |
| #define | ZIX_UNUSED(name) |
Typedefs | |
| typedef int(* | ZixComparator) (const void *a, const void *b, const void *user_data) |
| typedef bool(* | ZixEqualFunc) (const void *a, const void *b) |
| typedef void(* | ZixDestroyFunc) (void *ptr) |
| typedef int(* | ZixComparator) (const void *a, const void *b, const void *user_data) |
| typedef bool(* | ZixEqualFunc) (const void *a, const void *b) |
| typedef void(* | ZixDestroyFunc) (void *ptr) |
| typedef int(* | ZixComparator) (const void *a, const void *b, void *user_data) |
| typedef bool(* | ZixEqualFunc) (const void *a, const void *b) |
| typedef void(* | ZixDestroyFunc) (void *ptr) |
| typedef int(* | ZixComparator) (const void *a, const void *b, void *user_data) |
| typedef bool(* | ZixEqualFunc) (const void *a, const void *b) |
| typedef void(* | ZixDestroyFunc) (void *ptr) |
Functions | |
| static const char * | zix_strerror (const ZixStatus status) |
Hash | |
| typedef struct ZixHashImpl | ZixHash |
| typedef uint32_t(* | ZixHashFunc) (const void *value) |
| typedef void(* | ZixHashVisitFunc) (void *value, void *user_data) |
| ZIX_API ZixHash * | zix_hash_new (ZixHashFunc hash_func, ZixEqualFunc equal_func, size_t value_size) |
| ZIX_API void | zix_hash_free (ZixHash *hash) |
| ZIX_PURE_API size_t | zix_hash_size (const ZixHash *hash) |
| ZIX_API ZixStatus | zix_hash_insert (ZixHash *hash, const void *value, void **inserted) |
| ZIX_API ZixStatus | zix_hash_remove (ZixHash *hash, const void *value) |
| ZIX_API void * | zix_hash_find (const ZixHash *hash, const void *value) |
| ZIX_API void | zix_hash_foreach (ZixHash *hash, ZixHashVisitFunc f, void *user_data) |
Tree | |
| typedef struct ZixTreeImpl | ZixTree |
| typedef struct ZixTreeNodeImpl | ZixTreeIter |
BTree | |
| typedef struct ZixBTreeImpl | ZixBTree |
| typedef struct ZixBTreeNodeImpl | ZixBTreeNode |
| typedef struct ZixBTreeIterImpl | ZixBTreeIter |
| ZIX_API ZixBTree * | zix_btree_new (ZixComparator cmp, void *cmp_data, ZixDestroyFunc destroy) |
Hash | |
| typedef struct ZixHashImpl | ZixHash |
| typedef uint32_t(* | ZixHashFunc) (const void *value) |
| typedef void(* | ZixHashVisitFunc) (void *value, void *user_data) |
| ZIX_API ZixStatus | zix_hash_insert (ZixHash *hash, const void *value, const void **inserted) |
| #define ZIX_LOG_FUNC | ( | fmt, | |
| arg1 ) |
| #define ZIX_LOG_FUNC | ( | fmt, | |
| arg1 ) |
| typedef struct ZixBTreeImpl ZixBTree |
A B-Tree.
| typedef struct ZixBTreeImpl ZixBTree |
A B-Tree.
| typedef struct ZixBTreeIterImpl ZixBTreeIter |
An iterator over a B-Tree.
Note that modifying the trees invalidates all iterators, so all iterators are const iterators.
| typedef struct ZixBTreeIterImpl ZixBTreeIter |
An iterator over a B-Tree.
Note that modifying the trees invalidates all iterators, so all iterators are const iterators.
| typedef struct ZixBTreeNodeImpl ZixBTreeNode |
A B-Tree node (opaque).
| typedef struct ZixBTreeNodeImpl ZixBTreeNode |
A B-Tree node (opaque).
Function for comparing two elements.
Function for comparing two elements.
Function for comparing two elements.
Function for comparing two elements.
Function for testing equality of two elements.
Function for testing equality of two elements.
Function for testing equality of two elements.
Function for testing equality of two elements.
| typedef struct ZixHashImpl ZixHash |
| typedef struct ZixHashImpl ZixHash |
| typedef struct ZixTreeImpl ZixTree |
A balanced binary search tree.
| typedef struct ZixTreeImpl ZixTree |
A balanced binary search tree.
| typedef struct ZixTreeNodeImpl ZixTreeIter |
An iterator over a ZixTree.
| typedef struct ZixTreeNodeImpl ZixTreeIter |
An iterator over a ZixTree.
| enum ZixStatus |
| enum ZixStatus |
| enum ZixStatus |
| enum ZixStatus |
| ZIX_PURE_API ZixBTreeIter * zix_btree_begin | ( | const ZixBTree * | t | ) |
Return an iterator to the first (smallest) element in t.
The returned iterator must be freed with zix_btree_iter_free().
| ZIX_API ZixBTreeIter * zix_btree_end | ( | const ZixBTree * | t | ) |
Return an iterator to the end of t (one past the last element).
The returned iterator must be freed with zix_btree_iter_free().
| ZIX_PURE_API void * zix_btree_get | ( | const ZixBTreeIter * | ti | ) |
Return the data associated with the given tree item.
| ZIX_API ZixBTreeIter * zix_btree_iter_copy | ( | const ZixBTreeIter * | i | ) |
Return a new copy of i.
| ZIX_PURE_API bool zix_btree_iter_equals | ( | const ZixBTreeIter * | lhs, |
| const ZixBTreeIter * | rhs ) |
Return true iff lhs is equal to rhs.
| ZIX_API void zix_btree_iter_free | ( | ZixBTreeIter * | i | ) |
Free i.
| ZIX_API void zix_btree_iter_increment | ( | ZixBTreeIter * | i | ) |
Increment i to point to the next element in the tree.
| ZIX_PURE_API bool zix_btree_iter_is_end | ( | const ZixBTreeIter * | i | ) |
Return true iff i is an iterator to the end of its tree.
| ZIX_API ZixBTree * zix_btree_new | ( | ZixComparator | cmp, |
| const void * | cmp_data, | ||
| ZixDestroyFunc | destroy ) |
Create a new (empty) B-Tree.
| ZIX_API ZixBTree * zix_btree_new | ( | ZixComparator | cmp, |
| void * | cmp_data, | ||
| ZixDestroyFunc | destroy ) |
Create a new (empty) B-Tree.
| ZIX_API ZixStatus zix_btree_remove | ( | ZixBTree * | t, |
| const void * | e, | ||
| void ** | out, | ||
| ZixBTreeIter ** | next ) |
| t | Tree to remove from. |
| e | Value to remove. |
| out | Set to point to the removed pointer (which may not equal e). |
| next | If non-NULL, pointed to the value following e. If *next is also non-NULL, the iterator is reused, otherwise a new one is allocated. To reuse an iterator, no items may have been added since its creation. |
Search for an item in hash.
| hash | The hash table. |
| value | The value to search for. |
| ZIX_API void zix_hash_foreach | ( | ZixHash * | hash, |
| ZixHashVisitFunc | f, | ||
| void * | user_data ) |
Insert an item into hash.
If no matching value is found, ZIX_STATUS_SUCCESS will be returned, and inserted will be pointed to the copy of value made in the new hash node.
If a matching value already exists, ZIX_STATUS_EXISTS will be returned, and inserted will be pointed to the existing value.
| hash | The hash table. |
| value | The value to be inserted. |
| inserted | The copy of value in the hash table. |
Insert an item into hash.
If no matching value is found, ZIX_STATUS_SUCCESS will be returned, and inserted will be pointed to the copy of value made in the new hash node.
If a matching value already exists, ZIX_STATUS_EXISTS will be returned, and inserted will be pointed to the existing value.
| hash | The hash table. |
| value | The value to be inserted. |
| inserted | The copy of value in the hash table. |
| ZIX_API ZixHash * zix_hash_new | ( | ZixHashFunc | hash_func, |
| ZixEqualFunc | equal_func, | ||
| size_t | value_size ) |
Create a new hash table.
To minimize space overhead, unlike many hash tables this stores a single value, not a key and a value. Any size of value can be stored, but all the values in the hash table must be the same size, and the values must be safe to copy with memcpy. To get key:value behaviour, simply insert a struct with a key and value into the hash.
| hash_func | The hashing function. |
| equal_func | A function to test value equality. |
| value_size | The size of the values to be stored. |
Remove an item from hash.
| hash | The hash table. |
| value | The value to remove. |
| ZIX_PURE_API ZixTreeIter * zix_tree_begin | ( | ZixTree * | t | ) |
Return an iterator to the first (smallest) element in t.
| ZIX_API ZixTreeIter * zix_tree_end | ( | ZixTree * | t | ) |
Return an iterator the the element one past the last element in t.
| ZIX_PURE_API void * zix_tree_get | ( | const ZixTreeIter * | ti | ) |
Return the data associated with the given tree item.
| ZIX_API ZixStatus zix_tree_insert | ( | ZixTree * | t, |
| void * | e, | ||
| ZixTreeIter ** | ti ) |
| ZIX_CONST_API bool zix_tree_iter_is_end | ( | const ZixTreeIter * | i | ) |
Return true iff i is an iterator to the end of its tree.
| ZIX_CONST_API bool zix_tree_iter_is_rend | ( | const ZixTreeIter * | i | ) |
Return true iff i is an iterator to the reverse end of its tree.
| ZIX_PURE_API ZixTreeIter * zix_tree_iter_next | ( | ZixTreeIter * | i | ) |
Return an iterator that points to the element one past i.
| ZIX_PURE_API ZixTreeIter * zix_tree_iter_prev | ( | ZixTreeIter * | i | ) |
Return an iterator that points to the element one before i.
| ZIX_API ZixTree * zix_tree_new | ( | bool | allow_duplicates, |
| ZixComparator | cmp, | ||
| void * | cmp_data, | ||
| ZixDestroyFunc | destroy ) |
Create a new (empty) tree.
| ZIX_PURE_API ZixTreeIter * zix_tree_rbegin | ( | ZixTree * | t | ) |
Return an iterator to the last (largest) element in t.
| ZIX_API ZixStatus zix_tree_remove | ( | ZixTree * | t, |
| ZixTreeIter * | ti ) |
Remove the item pointed at by ti from t.
| ZIX_API ZixTreeIter * zix_tree_rend | ( | ZixTree * | t | ) |
Return an iterator the the element one before the first element in t.