quakeforge/ruamoko/include/stdlib.h
Bill Currie 5ca792c40e [ruamoko] Add some stdlib function wrappers
For now, just bsearch (normal and fuzzy), qsort, and prefixsum (not in
C's stdlib that I know of, but I think having native implementations of
float and int prefix sums will be useful.
2021-06-01 18:53:53 +09:00

17 lines
701 B
C

#ifndef __stdlib_h
#define __stdlib_h
//FIXME add const to qfcc?
// If compare is nil, the value pointed to by key and the first member of the
// elements in the array are treated as ints, making for fast searches when the
// first member of the element is the key and is a simple int
void *bsearch (void *key, void *array, int nmemb, int size,
int (*compare) (void *a, void *b));
void *fbsearch (void *key, void *array, int nmemb, int size,
int (*compare) (void *a, void *b));
void *qsort (void *array, int nmemb, int size,
int (*compare) (void *a, void *b));
@overload void prefixsum (int *array, int count);
@overload void prefixsum (float *array, int count);
#endif//__stdlib_h