Dynarr 0.0.1
C dynamic array
Loading...
Searching...
No Matches

Methods for querying the dynarr. More...

Collaboration diagram for Searches:

Functions

void * vector_linear_find (const vector_t *const vector, const size_t limit, const predicate_t predicate, void *const param)
 
void * vector_binary_find (const vector_t *const vector, const void *const value, const size_t limit, const compare_t cmp, void *const param)
 
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)
 
void * dynarr_binary_find (const dynarr_t *const dynarr, const void *const value, const compare_t cmp, void *const param)
 Binary search for the element with matching value.
 
ssize_t dynarr_binary_find_index (const dynarr_t *const dynarr, const void *const value, const compare_t cmp, void *const param)
 Binary search for the element with matching value.
 

Detailed Description

Methods for querying the dynarr.

Function Documentation

◆ dynarr_binary_find()

void * dynarr_binary_find ( const dynarr_t *const dynarr,
const void *const value,
const compare_t cmp,
void *const param )

Binary search for the element with matching value.

Searches for an element that matches value.

Parameters
[in]dynarrInstance of a dynarr.
[in]valueValue to be used as reference for comparison.
[in]cmpCompare callback.
paramParameter that will be passed to callback.
Returns
Pointer to a location of the matching element or NULL, when nothing matched.

Definition at line 213 of file dynarr.c.

Here is the call graph for this function:

◆ dynarr_binary_find_index()

ssize_t dynarr_binary_find_index ( const dynarr_t *const dynarr,
const void *const value,
const compare_t cmp,
void *const param )

Binary search for the element with matching value.

Searches for an element that matches value.

Parameters
[in]dynarrInstance of a dynarr.
[in]valueValue to be used as reference for comparison.
[in]cmpCompare callback.
paramParameter that will be passed to callback.
Returns
Index of matching element or -1 when no element matched.

Definition at line 226 of file dynarr.c.

Here is the call graph for this function: