Vector 0.0.2
|
Methods for querying the vector. More...
Functions | |
void * | vector_linear_find (const vector_t *const vector, const size_t limit, const predicate_t predicate, void *const param) |
Simple linear search for unordered data. | |
void * | vector_binary_find (const vector_t *const vector, const void *const value, const size_t limit, const compare_t cmp, void *const param) |
Run binary search on the vector. | |
ssize_t | vector_binary_find_index (const vector_t *const vector, const void *const value, const size_t limit, const compare_t cmp, void *const param) |
Run binary search on the vector. | |
Methods for querying the vector.
void * vector_linear_find | ( | const vector_t *const | vector, |
const size_t | limit, | ||
const predicate_t | predicate, | ||
void *const | param ) |
Simple linear search for unordered data.
Linear search for a value in the vector with parametrized predicate. If no matching element found returns null pointer, otherwise pointer to a legit location in vector's memory span.
[in] | vector | Pointer to a vector instance. |
[in] | limit | Iteration limit before break. |
[in] | predicate | Condition for desired element to be found. |
[in] | param | User defined parameter, passed to predicate . |
Definition at line 215 of file vector.c.
void * vector_binary_find | ( | const vector_t *const | vector, |
const void *const | value, | ||
const size_t | limit, | ||
const compare_t | cmp, | ||
void *const | param ) |
Run binary search on the vector.
[in] | vector | Pointer to a vector instance. |
[in] | value | Reference value to be compared to elements. |
[in] | limit | Iteration limit before break. |
[in] | cmp | Condition for desired element to be found. |
[in] | param | User defined parameter, passed to predicate . |
Definition at line 234 of file vector.c.
ssize_t vector_binary_find_index | ( | const vector_t *const | vector, |
const void *const | value, | ||
const size_t | limit, | ||
const compare_t | cmp, | ||
void *const | param ) |
Run binary search on the vector.
[in] | vector | Pointer to a vector instance. |
[in] | value | Reference value to be compared to elements. |
[in] | limit | Iteration limit before break. |
[in] | cmp | Condition for desired element to be found. |
[in] | param | User defined parameter, passed to predicate . |
NULL
if none. Definition at line 249 of file vector.c.