Add copyright
[unix-history] / usr / src / lib / libc / stdlib / qsort.3
CommitLineData
bfbd68e0
KM
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.
4.\"
dc15bb49 5.\" @(#)qsort.3 6.1 (Berkeley) %G%
bfbd68e0 6.\"
dc15bb49 7.TH QSORT 3 ""
bfbd68e0
KM
8.UC 4
9.SH NAME
10qsort \- quicker sort
11.SH SYNOPSIS
12.nf
13.B qsort(base, nel, width, compar)
14.B char *base;
15.B int (*compar)();
16.fi
17.SH DESCRIPTION
18.I Qsort
f921b318 19is an implementation of the quicker-sort algorithm.
bfbd68e0
KM
20The first argument is a pointer to the base of the data;
21the second is the number of elements;
f921b318 22the third is the width of an element in bytes;
bfbd68e0
KM
23the last is the name of the comparison routine
24to be called with two arguments which are pointers
25to the elements being compared.
f921b318 26The routine must return an integer less than, equal to, or greater than 0
bfbd68e0
KM
27according as the first argument is to be considered
28less than, equal to, or greater than the second.
29.SH "SEE ALSO"
30sort(1)