1 --- qsort.3.orig 2009-05-12 11:21:33.000000000 -0700
2 +++ qsort.3 2009-05-20 15:00:21.000000000 -0700
7 -.Nm qsort , qsort_r , heapsort , mergesort
13 +#ifdef UNIFDEF_BLOCKS
17 +#ifdef UNIFDEF_BLOCKS
35 .Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]"
39 +#ifdef UNIFDEF_BLOCKS
46 -.Fa "int \*[lp]*compar\*[rp]\*[lp]void *, const void *, const void *\*[rp]"
49 +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]"
60 .Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]"
62 +#ifdef UNIFDEF_BLOCKS
71 +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]"
79 .Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]"
81 +#ifdef UNIFDEF_BLOCKS
87 +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]"
96 +.Fa "int \*[lp]*compar\*[rp]\*[lp]void *, const void *, const void *\*[rp]"
102 function is a modified selection sort.
105 -function is a modified merge sort with exponential search
106 +function is a modified merge sort with exponential search,
107 intended for sorting data with pre-existing order.
113 functions sort an array of
116 objects, the initial member of which is pointed to by
118 The size of each object is specified by
124 behaves similarly, but
130 +be greater than or equal to
131 .Dq "sizeof(void *) / 2" .
133 The contents of the array
138 -stable, that is, if two members compare as equal, their order in
139 +stable; that is, if two members compare as equal, their order in
140 the sorted array is undefined.
146 requires additional memory of size
151 bytes; it should be used only when space is not at a premium.
154 @@ -195,42 +232,83 @@
161 +which is faster than
163 Memory availability and pre-existing order in the data can make this
165 +#ifdef UNIFDEF_BLOCKS
172 +routines are like the corresponding routines without the _b suffix, expect
175 +callback is a block pointer instead of a function pointer.
179 +#ifdef UNIFDEF_BLOCKS
190 -.Rv -std heapsort mergesort
191 +#ifdef UNIFDEF_BLOCKS
192 +.ds HEAPSORT_B heapsort_b
193 +.ds MERGESORT_B mergesort_b
195 +.Rv -std heapsort \*[HEAPSORT_B] mergesort \*[MERGESORT_B]
198 +#ifdef UNIFDEF_BLOCKS
209 functions succeed unless:
215 argument is zero, or,
221 +#ifdef UNIFDEF_BLOCKS
226 .Dq "sizeof(void *) / 2" .
229 +#ifdef UNIFDEF_BLOCKS
242 were unable to allocate memory.