xref: /csrg-svn/usr.bin/f77/libU77/qsort_.c (revision 23044)
12521Sdlw /*
2*23044Skre  * Copyright (c) 1980 Regents of the University of California.
3*23044Skre  * All rights reserved.  The Berkeley software License Agreement
4*23044Skre  * specifies the terms and conditions for redistribution.
52521Sdlw  *
6*23044Skre  *	@(#)qsort_.c	5.1	06/07/85
7*23044Skre  */
8*23044Skre 
9*23044Skre /*
102521Sdlw  * quick sort interface
112521Sdlw  *
122521Sdlw  * calling sequence:
132521Sdlw  *	external compar
142521Sdlw  *	call qsort (array, len, isize, compar)
152521Sdlw  *	----
162521Sdlw  *	integer*2 function compar (obj1, obj2)
172521Sdlw  * where:
182521Sdlw  *	array contains the elements to be sorted
192521Sdlw  *	len is the number of elements in the array
202521Sdlw  *	isize is the size of an element, typically -
212521Sdlw  *		4 for integer, float
222521Sdlw  *		8 for double precision
232521Sdlw  *		(length of character object) for character arrays
242521Sdlw  *	compar is the name of an integer*2 function that will return -
252521Sdlw  *		<0 if object 1 is logically less than object 2
262521Sdlw  *		=0 if object 1 is logically equal to object 2
272521Sdlw  *		>0 if object 1 is logically greater than object 2
282521Sdlw  */
292521Sdlw 
302521Sdlw qsort_(array, len, isize, compar)
312521Sdlw long *len, *isize;
322521Sdlw long *array;
332521Sdlw int (*compar)(); /* may be problematical */
342521Sdlw {
352521Sdlw 	qsort(array, (int)*len, (int)*isize, compar);
362521Sdlw }
37