BRL-CAD
sort.h
Go to the documentation of this file.
1 /* S O R T . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 /** @file sort.h
22  *
23  */
24 #ifndef BU_SORT_H
25 #define BU_SORT_H
26 
27 #include "common.h"
28 
29 #include <stddef.h> /* for size_t */
30 
31 #include "bu/defines.h"
32 
34 
35 /** @addtogroup sort */
36 /** @{ */
37 
38 /** @file libbu/sort.c
39  * platform-independent re-entrant version of qsort, where the first argument
40  * is the array to sort, the second the number of elements inside the array, the
41  * third the size of one element, the fourth the comparison-function and the
42  * fifth a variable which is handed as a third argument to the comparison-function.
43  */
44 BU_EXPORT extern void bu_sort(void *array, size_t nummemb, size_t sizememb,
45  int (*compare)(const void *, const void *, void *), void *context);
46 
47 
48 /** @} */
49 
51 
52 #endif /* BU_SORT_H */
53 
54 /*
55  * Local Variables:
56  * mode: C
57  * tab-width: 8
58  * indent-tabs-mode: t
59  * c-file-style: "stroustrup"
60  * End:
61  * ex: shiftwidth=4 tabstop=8
62  */
Header file for the BRL-CAD common definitions.
#define __BEGIN_DECLS
Definition: common.h:73
void bu_sort(void *array, size_t nummemb, size_t sizememb, int(*compare)(const void *, const void *, void *), void *context)
Definition: sort.c:110
#define __END_DECLS
Definition: common.h:74