aboutsummaryrefslogtreecommitdiff
path: root/include/bh/algo.h
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2025-01-30 13:53:26 +0300
committerMikhail Romanko <me@blankhex.com>2025-02-02 21:13:34 +0300
commitc89cf8f3165fa8c60b2d945716d071f390add973 (patch)
tree89f1a7ff2a67ddc33c36d3283856904135761963 /include/bh/algo.h
parent8d73a9b47335cad686da67c1f04ce50c84c601bd (diff)
downloadbhlib-c89cf8f3165fa8c60b2d945716d071f390add973.tar.gz
Change code and naming style, fix several bugs, removed math types.
After a while I felt that putting underscores between words was not the best solution, so I changed the underscores to capital letters. Fixed consistency bug between POSIX/Win32 platform in BH_FileOpen. Removed definitions for math types (vector, matrix, etc.) due to potential aliasing issues.
Diffstat (limited to 'include/bh/algo.h')
-rwxr-xr-xinclude/bh/algo.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/include/bh/algo.h b/include/bh/algo.h
index f549f1a..5d9bb36 100755
--- a/include/bh/algo.h
+++ b/include/bh/algo.h
@@ -12,7 +12,7 @@
* \param src Pointer to the element
* \param size Element size in bytes
*/
-void bh_swap(void *dest,
+void BH_Swap(void *dest,
void *src,
size_t size);
@@ -30,11 +30,11 @@ void bh_swap(void *dest,
*
* \return Pointer to the first element of the second partition.
*/
-void *bh_partition(void *pivot,
+void *BH_Partition(void *pivot,
void *array,
size_t size,
size_t element,
- bh_equal_cb_t equal);
+ BH_EqualCallback equal);
/**
@@ -45,10 +45,10 @@ void *bh_partition(void *pivot,
* \param element Element size in bytes
* \param equal Comparision function
*/
-void bh_sort(void *array,
+void BH_Sort(void *array,
size_t size,
size_t element,
- bh_equal_cb_t equal);
+ BH_EqualCallback equal);
/**
@@ -59,10 +59,10 @@ void bh_sort(void *array,
* \param element Element size in bytes
* \param equal Comparision function
*/
-void bh_heap_make(void *array,
- size_t size,
- size_t element,
- bh_equal_cb_t equal);
+void BH_HeapMake(void *array,
+ size_t size,
+ size_t element,
+ BH_EqualCallback equal);
/**
@@ -73,10 +73,10 @@ void bh_heap_make(void *array,
* \param element Element size in bytes
* \param equal Comparasion function
*/
-void bh_heap_remove(void *array,
- size_t size,
- size_t element,
- bh_equal_cb_t equal);
+void BH_HeapRemove(void *array,
+ size_t size,
+ size_t element,
+ BH_EqualCallback equal);
/**
@@ -91,11 +91,11 @@ void bh_heap_remove(void *array,
* \param element Element size in bytes
* \param equal Comparasion function
*/
-void bh_heap_insert(void *value,
- void *array,
- size_t size,
- size_t element,
- bh_equal_cb_t equal);
+void BH_HeapInsert(void *value,
+ void *array,
+ size_t size,
+ size_t element,
+ BH_EqualCallback equal);
/**
@@ -106,8 +106,8 @@ void bh_heap_insert(void *value,
*
* This function is roughly equivalent to the following code:
* \code
- * bh_heap_remove(array, size, element, equal);
- * bh_heap_insert(value, array, size - 1, element, equal);
+ * BH_HeapRemove(array, size, element, equal);
+ * BH_HeapInsert(value, array, size - 1, element, equal);
* \endcode
*
* \param value Pointer to the value
@@ -116,11 +116,11 @@ void bh_heap_insert(void *value,
* \param element Element size in bytes
* \param equal Comparasion function
*/
-void bh_heap_replace(void *value,
- void *array,
- size_t size,
- size_t element,
- bh_equal_cb_t equal);
+void BH_HeapReplace(void *value,
+ void *array,
+ size_t size,
+ size_t element,
+ BH_EqualCallback equal);
#endif /* BH_ALGO_H */