array_binary_search


Description:


public void* array_binary_search (void* array, uint num_elements, size_t element_size, CompareDataFunc<void*> search_func, SearchMode mode, void* search_data)

Searches inside array for search_data by using the comparison function search_func.

array must be sorted ascending.

As search_data is always passed as second argument to search_func it's not required that search_data has the same type as the array elements.

The complexity of this search function is O(log (num_elements)).

Parameters:

array

the sorted input array

num_elements

number of elements in the array

element_size

size of every element in bytes

search_func

function to compare two elements, search_data will always be passed as second argument

mode

search mode that should be used

search_data

element that should be found

user_data

data to pass to search_func

Returns:

The address of the found element or null if nothing was found


Namespace: Gst.Util
Package: gstreamer-1.0



2022 vala-language.org