mirror of
https://github.com/transmission/transmission.git
synced 2025-12-27 05:38:40 +00:00
refactor: web_utils (#2121)
* chore: move web utils from web, utils to web-utils
This commit is contained in:
@@ -30,6 +30,8 @@ struct tr_ptrArray
|
||||
int n_alloc;
|
||||
};
|
||||
|
||||
using tr_voidptr_compare_func = int (*)(void const* lhs, void const* rhs);
|
||||
|
||||
using PtrArrayCompareFunc = tr_voidptr_compare_func;
|
||||
|
||||
using PtrArrayForeachFunc = void (*)(void*);
|
||||
@@ -121,4 +123,13 @@ void tr_ptrArrayRemoveSortedPointer(tr_ptrArray* t, void const* ptr, tr_voidptr_
|
||||
@return the matching pointer, or nullptr if no match was found */
|
||||
void* tr_ptrArrayFindSorted(tr_ptrArray* array, void const* key, tr_voidptr_compare_func compare);
|
||||
|
||||
/** @brief similar to bsearch() but returns the index of the lower bound */
|
||||
int tr_lowerBound(
|
||||
void const* key,
|
||||
void const* base,
|
||||
size_t nmemb,
|
||||
size_t size,
|
||||
tr_voidptr_compare_func compar,
|
||||
bool* exact_match) TR_GNUC_HOT TR_GNUC_NONNULL(1, 5, 6);
|
||||
|
||||
/* @} */
|
||||
|
||||
Reference in New Issue
Block a user