Debian Codegraph @

modules/lsp-common-lib/include/lsp-plug.in/stdlib/stdlib.h

raw
1 /*
2 * Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2024 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-common-lib
6 * Created on: 21 нояб. 2020 г.
7 *
8 * lsp-common-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-common-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-common-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef LSP_PLUG_IN_STDLIB_STDLIB_H_
23 #define LSP_PLUG_IN_STDLIB_STDLIB_H_
24
25 #include <lsp-plug.in/common/version.h>
26 #include <lsp-plug.in/common/types.h>
27
28 #include <stdlib.h>
29
30
31 namespace lsp
32 {
33 typedef int (*sort_compar_t)(const void *a, const void *ab, void *arg);
34
35 /**
36 * Perform quick sort of the data using the comparison function that accepts an argument
37 *
38 * @param data array to sort
39 * @param count number of elements in array
40 * @param szof size of each element
41 * @param compar comparison function
42 * @param arg argument passed to the comparison function
43 */
44 LSP_COMMON_LIB_PUBLIC
45 void qsort_r(
46 void *data, size_t count, size_t szof,
47 int (*compar)(const void *a1, const void *a2, void *data),
48 void *arg
49 );
50 }
51
52 #endif /* LSP_PLUG_IN_STDLIB_STDLIB_H_ */