Back to home page

Redis cross reference

 
 

    


0001 /* The following is the NetBSD libc qsort implementation modified in order to
0002  * support partial sorting of ranges for Redis.
0003  *
0004  * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
0005  * All rights reserved.
0006  *
0007  * Redistribution and use in source and binary forms, with or without
0008  * modification, are permitted provided that the following conditions are met:
0009  *
0010  *   * Redistributions of source code must retain the above copyright notice,
0011  *     this list of conditions and the following disclaimer.
0012  *   * Redistributions in binary form must reproduce the above copyright
0013  *     notice, this list of conditions and the following disclaimer in the
0014  *     documentation and/or other materials provided with the distribution.
0015  *   * Neither the name of Redis nor the names of its contributors may be used
0016  *     to endorse or promote products derived from this software without
0017  *     specific prior written permission.
0018  *
0019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0020  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0022  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0023  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0024  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0025  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0026  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0027  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0028  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0029  * POSSIBILITY OF SUCH DAMAGE.
0030  *
0031  * See the pqsort.c file for the original copyright notice. */
0032 
0033 #ifndef __PQSORT_H
0034 #define __PQSORT_H
0035 
0036 void
0037 pqsort(void *a, size_t n, size_t es,
0038     int (*cmp) (const void *, const void *), size_t lrange, size_t rrange);
0039 
0040 #endif