xpcom/glue/nsQuickSort.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * 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
    31  */
    32 NS_COM_GLUE void NS_QuickSort(void *, unsigned int, unsigned int,
    33                               int (*)(const void *, const void *, void *), 
    34                               void *);
    36 #ifdef __cplusplus
    37 }
    38 #endif
    40 #endif /* nsQuickSort_h___ */

mercurial