xref: /original-bsd/usr.bin/f77/libU77/qsort_.c (revision 5998a314)
1 /*
2 char id_qsort[] = "@(#)qsort_.c	1.1";
3  *
4  * quick sort interface
5  *
6  * calling sequence:
7  *	external compar
8  *	call qsort (array, len, isize, compar)
9  *	----
10  *	integer*2 function compar (obj1, obj2)
11  * where:
12  *	array contains the elements to be sorted
13  *	len is the number of elements in the array
14  *	isize is the size of an element, typically -
15  *		4 for integer, float
16  *		8 for double precision
17  *		(length of character object) for character arrays
18  *	compar is the name of an integer*2 function that will return -
19  *		<0 if object 1 is logically less than object 2
20  *		=0 if object 1 is logically equal to object 2
21  *		>0 if object 1 is logically greater than object 2
22  */
23 
24 qsort_(array, len, isize, compar)
25 long *len, *isize;
26 long *array;
27 int (*compar)(); /* may be problematical */
28 {
29 	qsort(array, (int)*len, (int)*isize, compar);
30 }
31