1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 
8 /* We need this because Solaris' version of qsort is broken and
9  * causes array bounds reads.
10  */
11 
12 #ifndef nsQuickSort_h___
13 #define nsQuickSort_h___
14 
15 #include "nscore.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /**
22  * Parameters:
23  *  1. the array to sort
24  *  2. the number of elements in the array
25  *  3. the size of each array element
26  *  4. comparison function taking two elements and parameter #5 and
27  *     returning an integer:
28  *      + less than zero if the first element should be before the second
29  *      + 0 if the order of the elements does not matter
30  *      + greater than zero if the second element should be before the first
31  *  5. extra data to pass to comparison function
32  */
33 void NS_QuickSort(void*, unsigned int, unsigned int,
34                   int (*)(const void*, const void*, void*),
35                   void*);
36 
37 #ifdef __cplusplus
38 }
39 #endif
40 
41 #endif /* nsQuickSort_h___ */
42