Bug 1690340 - Part 4: Insert the "Page Source" before the "Extensions for Developers...
[gecko.git] / xpcom / ds / nsQuickSort.h
blobc2b842bea30922129db9a1531507cf321aa456f2
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/. */
7 /* We need this because Solaris' version of qsort is broken and
8 * causes array bounds reads.
9 */
11 #ifndef nsQuickSort_h___
12 #define nsQuickSort_h___
14 #include "nscore.h"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 /**
21 * Parameters:
22 * 1. the array to sort
23 * 2. the number of elements in the array
24 * 3. the size of each array element
25 * 4. comparison function taking two elements and parameter #5 and
26 * returning an integer:
27 * + less than zero if the first element should be before the second
28 * + 0 if the order of the elements does not matter
29 * + greater than zero if the second element should be before the first
30 * 5. extra data to pass to comparison function
32 void NS_QuickSort(void*, unsigned int, unsigned int,
33 int (*)(const void*, const void*, void*), void*);
35 #ifdef __cplusplus
37 #endif
39 #endif /* nsQuickSort_h___ */