466
|
1 <refentry id="qsort">
|
|
2 <refnamediv>
|
573
|
3 <refname>Qsort</refname>
|
|
4 <refpurpose>quick sort</refpurpose>
|
466
|
5 </refnamediv>
|
|
6
|
|
7 <refsynopsisdiv>
|
|
8 <funcsynopsis>
|
|
9 <funcprototype>
|
|
10 <funcdef><function>qsort</function></funcdef>
|
472
|
11 <paramdef>char *<parameter>base</parameter></paramdef>
|
|
12 <paramdef>int <parameter>n</parameter></paramdef>
|
|
13 <paramdef>int <parameter>size</parameter></paramdef>
|
573
|
14 <paramdef>int <parameter>(* compfunc)</parameter>
|
472
|
15 <funcparams>void *, void *</funcparams></paramdef>
|
466
|
16 </funcprototype>
|
|
17 </funcsynopsis>
|
|
18
|
|
19 </refsynopsisdiv>
|
|
20
|
|
21 <refsect1><title>Description</title>
|
|
22 <para>
|
472
|
23 Qsort implements the quick-sort algoritm for sortig an
|
|
24 arbitrary array of items.
|
|
25 </para>
|
|
26 <para>
|
|
27 "Base" is the address of the array of "n" items of size "size".
|
|
28 "Compfunc" is a pointer to a comparison routine supplied by
|
|
29 the user. It will be called by qsort with two pointers to
|
|
30 items in the array for comparison and should return an integer
|
|
31 which is less than, equal to, or greater than 0 where,
|
|
32 respectively, the first item is less than, equal to, or greater
|
|
33 than the second.
|
466
|
34 </para>
|
|
35 </refsect1>
|
|
36 </refentry>
|