haiku/headers/compatibility/gnu/stdlib.h
CodeforEvolution 5c32512076 GNU Compatibility: Implement qsort_r
This is a version of the qsort function allowing you to pass a "cookie" to the function.

Change-Id: I60c645213b9c9590e38b112634fcac1d7969b6d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2449
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-18 06:25:20 +00:00

37 lines
619 B
C

/*
* Copyright 2020 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Isaac Turner, turner.isaac@gmail.com
* Jacob Secunda, secundaja@gmail.com
*/
#ifndef _GNU_STDLIB_H_
#define _GNU_STDLIB_H_
#include_next <stdlib.h>
#ifdef _GNU_SOURCE
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*_compare_function_qsort_r)(const void*, const void*, void*);
extern void qsort_r(void* base, size_t numElements, size_t sizeOfElement,
_compare_function_qsort_r, void* cookie);
#ifdef __cplusplus
}
#endif
#endif /* _GNU_SOURCE */
#endif /* _GNU_STDLIB_H_ */