Skip to main content

SDL_CompareCallback

Type Alias SDL_CompareCallback 

Source
pub type SDL_CompareCallback = Option<unsafe extern "C" fn(a: *const c_void, b: *const c_void) -> c_int>;
Expand description

A callback used with SDL sorting and binary search functions.

Parameter: a a pointer to the first element being compared. Parameter: b a pointer to the second element being compared. Returns: -1 if a should be sorted before b, 1 if b should be sorted before a, 0 if they are equal. If two elements are equal, their order in the sorted array is undefined.

Available Since: This callback is available since SDL 3.2.0.

See Also: SDL_bsearch See Also: SDL_qsort

Aliased Type§

pub enum SDL_CompareCallback {
    None,
    Some(unsafe extern "C" fn(*const c_void, *const c_void) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*const c_void, *const c_void) -> i32)

Some value of type T.