annotate docs/ccguide/qsort.refentry @ 573:d9ab3688bb71

All function prototypes are added.
author roug
date Fri, 01 Nov 2002 10:02:34 +0000
parents f0c8d53e5a50
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
1 <refentry id="qsort">
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
2 <refnamediv>
573
d9ab3688bb71 All function prototypes are added.
roug
parents: 472
diff changeset
3 <refname>Qsort</refname>
d9ab3688bb71 All function prototypes are added.
roug
parents: 472
diff changeset
4 <refpurpose>quick sort</refpurpose>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
5 </refnamediv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
6
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
7 <refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
8 <funcsynopsis>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
9 <funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
10 <funcdef><function>qsort</function></funcdef>
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
11 <paramdef>char *<parameter>base</parameter></paramdef>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
12 <paramdef>int <parameter>n</parameter></paramdef>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
13 <paramdef>int <parameter>size</parameter></paramdef>
573
d9ab3688bb71 All function prototypes are added.
roug
parents: 472
diff changeset
14 <paramdef>int <parameter>(* compfunc)</parameter>
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
15 <funcparams>void *, void *</funcparams></paramdef>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
16 </funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
17 </funcsynopsis>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
18
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
19 </refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
20
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
21 <refsect1><title>Description</title>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
22 <para>
472
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
23 Qsort implements the quick-sort algoritm for sortig an
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
24 arbitrary array of items.
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
25 </para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
26 <para>
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
27 "Base" is the address of the array of "n" items of size "size".
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
28 "Compfunc" is a pointer to a comparison routine supplied by
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
29 the user. It will be called by qsort with two pointers to
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
30 items in the array for comparison and should return an integer
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
31 which is less than, equal to, or greater than 0 where,
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
32 respectively, the first item is less than, equal to, or greater
f0c8d53e5a50 entered: chdir chmod qsort strass toupper tsleep wait
roug
parents: 466
diff changeset
33 than the second.
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
34 </para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
35 </refsect1>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
36 </refentry>