summaryrefslogtreecommitdiffstats
path: root/zix/hash.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-31 15:15:05 +0100
committerDavid Robillard <d@drobilla.net>2020-12-31 15:21:29 +0100
commit741c3349b09c8774fcd013e3bdd7d9e7f6b470ce (patch)
treea941f6567b85255570e5492f3c66a842704ba9f7 /zix/hash.h
parent841c766d86dc35ab37c4fef8ec866d06c41bc383 (diff)
downloadzix-741c3349b09c8774fcd013e3bdd7d9e7f6b470ce.tar.gz
zix-741c3349b09c8774fcd013e3bdd7d9e7f6b470ce.tar.bz2
zix-741c3349b09c8774fcd013e3bdd7d9e7f6b470ce.zip
Format all code with clang-format
Diffstat (limited to 'zix/hash.h')
-rw-r--r--zix/hash.h46
1 files changed, 22 insertions, 24 deletions
diff --git a/zix/hash.h b/zix/hash.h
index 2550676..bef1568 100644
--- a/zix/hash.h
+++ b/zix/hash.h
@@ -43,8 +43,7 @@ typedef uint32_t (*ZixHashFunc)(const void* value);
/**
Function to visit a hash element.
*/
-typedef void (*ZixHashVisitFunc)(void* value,
- void* user_data);
+typedef void (*ZixHashVisitFunc)(void* value, void* user_data);
/**
Create a new hash table.
@@ -59,21 +58,22 @@ typedef void (*ZixHashVisitFunc)(void* value,
@param equal_func A function to test value equality.
@param value_size The size of the values to be stored.
*/
-ZIX_API ZixHash*
-zix_hash_new(ZixHashFunc hash_func,
- ZixEqualFunc equal_func,
- size_t value_size);
+ZIX_API
+ZixHash*
+zix_hash_new(ZixHashFunc hash_func, ZixEqualFunc equal_func, size_t value_size);
/**
Free `hash`.
*/
-ZIX_API void
+ZIX_API
+void
zix_hash_free(ZixHash* hash);
/**
Return the number of elements in `hash`.
*/
-ZIX_PURE_API size_t
+ZIX_PURE_API
+size_t
zix_hash_size(const ZixHash* hash);
/**
@@ -90,10 +90,9 @@ zix_hash_size(const ZixHash* hash);
@param inserted The copy of `value` in the hash table.
@return ZIX_STATUS_SUCCESS, ZIX_STATUS_EXISTS, or ZIX_STATUS_NO_MEM.
*/
-ZIX_API ZixStatus
-zix_hash_insert(ZixHash* hash,
- const void* value,
- void** inserted);
+ZIX_API
+ZixStatus
+zix_hash_insert(ZixHash* hash, const void* value, void** inserted);
/**
Remove an item from `hash`.
@@ -102,9 +101,9 @@ zix_hash_insert(ZixHash* hash,
@param value The value to remove.
@return ZIX_STATUS_SUCCES or ZIX_STATUS_NOT_FOUND.
*/
-ZIX_API ZixStatus
-zix_hash_remove(ZixHash* hash,
- const void* value);
+ZIX_API
+ZixStatus
+zix_hash_remove(ZixHash* hash, const void* value);
/**
Search for an item in `hash`.
@@ -112,9 +111,9 @@ zix_hash_remove(ZixHash* hash,
@param hash The hash table.
@param value The value to search for.
*/
-ZIX_API void*
-zix_hash_find(const ZixHash* hash,
- const void* value);
+ZIX_API
+void*
+zix_hash_find(const ZixHash* hash, const void* value);
/**
Call `f` on each value in `hash`.
@@ -123,10 +122,9 @@ zix_hash_find(const ZixHash* hash,
@param f The function to call on each value.
@param user_data The user_data parameter passed to `f`.
*/
-ZIX_API void
-zix_hash_foreach(ZixHash* hash,
- ZixHashVisitFunc f,
- void* user_data);
+ZIX_API
+void
+zix_hash_foreach(ZixHash* hash, ZixHashVisitFunc f, void* user_data);
/**
@}
@@ -134,7 +132,7 @@ zix_hash_foreach(ZixHash* hash,
*/
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#endif /* ZIX_HASH_H */
+#endif /* ZIX_HASH_H */