Binary‐search a sorted array of fixed‐size elements using a comparator.

Synopsis

Declared in <openssl/objects.h>

void const*
OBJ_bsearch_(
    void const* key,
    void const* base,
    int num,
    int size,
    int(* cmp)(void const*, void const*));

Description

Used internally by the OBJ_bsearch_* helpers; prefer those type‐safe wrappers.

Return Value

Pointer to the matching element, or NULL if not found.

Parameters

Name

Description

key

Pointer to the search key passed as the first argument to cmp.

base

Base address of the sorted array.

num

Number of elements in the array.

size

Size of each element in bytes.

cmp

Comparison callback returning negative, zero, or positive like strcmp.

Created with MrDocs