1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)qsort.3 6.1 (Berkeley) 5/15/85
7 .TH QSORT 3 "May 15, 1985"
14 #include <sys/types.h>
20 void qsort(void *\fIbase\fP, size_t \fInel\fP, size_t \fIwidth\fP, int (*\fIcompar\fP)(const void *, const void *))
25 is an implementation of the quicker-sort algorithm.
26 The first argument is a pointer to the base of the data;
27 the second is the number of elements;
28 the third is the width of an element in bytes;
29 the last is the name of the comparison routine
30 to be called with two arguments which are pointers
31 to the elements being compared.
32 The routine must return an integer less than, equal to, or greater than 0
33 according as the first argument is to be considered
34 less than, equal to, or greater than the second.