1 --- qsort.3.orig 2010-10-07 21:23:04.000000000 -0700
2 +++ qsort.3 2010-10-07 21:24:45.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
69 +.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 @@ -192,19 +229,40 @@
159 +which is faster than
161 Memory availability and pre-existing order in the data can make this
163 +#ifdef UNIFDEF_BLOCKS
170 +routines are like the corresponding routines without the _b suffix, expect
173 +callback is a block pointer instead of a function pointer.
177 +#ifdef UNIFDEF_BLOCKS
188 -.Rv -std heapsort mergesort
189 +#ifdef UNIFDEF_BLOCKS
190 +.ds HEAPSORT_B heapsort_b
191 +.ds MERGESORT_B mergesort_b
193 +.Rv -std heapsort \*[HEAPSORT_B] mergesort \*[MERGESORT_B]
197 @@ -213,26 +271,46 @@
198 This is no longer true.
201 +#ifdef UNIFDEF_BLOCKS
212 functions succeed unless:
218 argument is zero, or,
224 +#ifdef UNIFDEF_BLOCKS
229 .Dq "sizeof(void *) / 2" .
232 +#ifdef UNIFDEF_BLOCKS
244 were unable to allocate memory.