diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-03-04 23:30:17 -0800 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-03-04 23:35:00 -0800 |
commit | 21a9a9bb078c062b7cb13f8d176a3375d7b01eb2 (patch) | |
tree | 9a1b50fe144182506ef49c3c4d9294d1f9255169 /trie.h | |
parent | 8ec4f46f31b1d2f71d193952e595e2037fe7f22d (diff) | |
download | bfs-21a9a9bb078c062b7cb13f8d176a3375d7b01eb2.tar.xz |
trie: Implement removal
Diffstat (limited to 'trie.h')
-rw-r--r-- | trie.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -106,6 +106,32 @@ struct trie_leaf *trie_insert_str(struct trie *trie, const char *key); struct trie_leaf *trie_insert_mem(struct trie *trie, const void *key, size_t length); /** + * Remove a string key from a trie. + * + * @param trie + * The trie to modify. + * @param key + * The key to remove. + * @return + * Whether the key was found. + */ +bool trie_remove_str(struct trie *trie, const char *key); + +/** + * Remove a fixed-size key from a trie. + * + * @param trie + * The trie to modify. + * @param key + * The key to remove. + * @param size + * The size of the key in bytes. + * @return + * Whether the key was found. + */ +bool trie_remove_mem(struct trie *trie, const void *key, size_t size); + +/** * Destroy a trie and its contents. */ void trie_destroy(struct trie *trie); |