* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/port.h,v 1.104 2006/10/04 00:30:06 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/port.h,v 1.105 2006/10/19 20:56:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
struct hostent ** result,
int *herrno);
+extern void pg_qsort(void *base, size_t nel, size_t elsize,
+ int (*cmp) (const void *, const void *));
+
+#define qsort(a,b,c,d) pg_qsort(a,b,c,d)
+
typedef int (*qsort_arg_comparator) (const void *a, const void *b, void *arg);
extern void qsort_arg(void *base, size_t nel, size_t elsize,
*
* CAUTION: if you change this file, see also qsort_arg.c
*
- * $PostgreSQL: pgsql/src/port/qsort.c,v 1.11 2006/10/12 15:04:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/port/qsort.c,v 1.12 2006/10/19 20:56:22 tgl Exp $
*/
/* $NetBSD: qsort.c,v 1.13 2003/08/07 16:43:42 agc Exp $ */
#include "c.h"
-static char *med3(char *, char *, char *,
- int (*) (const void *, const void *));
+static char *med3(char *a, char *b, char *c,
+ int (*cmp) (const void *, const void *));
static void swapfunc(char *, char *, size_t, int);
/*
#define vecswap(a, b, n) if ((n) > 0) swapfunc((a), (b), (size_t)(n), swaptype)
static char *
-med3(a, b, c, cmp)
-char *a,
- *b,
- *c;
-int (*cmp) (const void *, const void *);
+med3(char *a, char *b, char *c, int (*cmp) (const void *, const void *))
{
return cmp(a, b) < 0 ?
(cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a))
}
void
-qsort(a, n, es, cmp)
-void *a;
-size_t n,
- es;
-int (*cmp) (const void *, const void *);
+pg_qsort(void *a, size_t n, size_t es, int (*cmp) (const void *, const void *))
{
char *pa,
*pb,