Commit | Line | Data |
---|---|---|
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 | .\" | |
1eee95b5 | 5 | .\" @(#)qsort.3 6.2 (Berkeley) %G% |
bfbd68e0 | 6 | .\" |
dc15bb49 | 7 | .TH QSORT 3 "" |
bfbd68e0 KM |
8 | .UC 4 |
9 | .SH NAME | |
10 | qsort \- 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 | 19 | is an implementation of the quicker-sort algorithm. |
bfbd68e0 KM |
20 | The first argument is a pointer to the base of the data; |
21 | the second is the number of elements; | |
f921b318 | 22 | the third is the width of an element in bytes; |
bfbd68e0 KM |
23 | the last is the name of the comparison routine |
24 | to be called with two arguments which are pointers | |
25 | to the elements being compared. | |
f921b318 | 26 | The routine must return an integer less than, equal to, or greater than 0 |
bfbd68e0 KM |
27 | according as the first argument is to be considered |
28 | less than, equal to, or greater than the second. | |
29 | .SH "SEE ALSO" | |
30 | sort(1) | |
1eee95b5 KB |
31 | .SH BUGS |
32 | The comparison routine may not itself call \fIqsort\fP. |