1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2019 Google LLC
10 * qsort() - Use the quicksort algorithm to sort some values
12 * @base: Base address of array to sort
13 * @nmemb: Number of members to sort
14 * @size: Size of each member in bytes
15 * @compar: Comparison function which should return:
16 * < 0 if element at s1 < element at s2,
17 * 0 if element at s1 == element at s2,
18 * > 0 if element at s1 > element at s2,
20 void qsort(void *base, size_t nmemb, size_t size,
21 int (*compar)(const void *s1, const void *s2));
24 * strcmp_compar() - compar function for string arrays
26 * This can be passed to qsort when a string array is being sorted
28 * @s1: First string to compare
29 * @s2: Second string to compare
30 * @return comparison value (less than, equal to, or greater than 0)
32 int strcmp_compar(const void *s1, const void *s2);