00001 /* 00002 00003 Copyright (C) 1999-2001, Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2.1 of the GNU Lesser General Public License 00007 as published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, any 00012 license provided herein, whether implied or otherwise, is limited to 00013 this program in accordance with the express provisions of the 00014 GNU Lesser General Public License. 00015 00016 Patent licenses, if any, provided herein do not apply to combinations 00017 of this program with other product or programs, or any other product 00018 whatsoever. This program is distributed without any warranty that the 00019 program is delivered free of the rightful claim of any third person by 00020 way of infringement or the like. 00021 00022 See the GNU Lesser General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with this program; if not, write the Free Software Foundation, Inc., 59 00026 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00027 00028 */ 00029 00030 /* $Header: /proj/osprey/CVS/open64/osprey1.0/libU77/qsort_.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $ */ 00031 /* 00032 * 00033 * quick sort interface 00034 * 00035 * calling sequence: 00036 * f77external compar 00037 * call qsort (array, len, isize, compar) 00038 * ---- 00039 * integer*2 function compar (obj1, obj2) 00040 * where: 00041 * array contains the elements to be sorted 00042 * len is the number of elements in the array 00043 * isize is the size of an element, typically - 00044 * 4 for integer, float 00045 * 8 for double precision 00046 * (length of character object) for character arrays 00047 * compar is the name of an integer*2 function that will return - 00048 * <0 if object 1 is logically less than object 2 00049 * =0 if object 1 is logically equal to object 2 00050 * >0 if object 1 is logically greater than object 2 00051 * 00052 * Notes: len & isize must be representable in an integer *4 even though 00053 * the C library 00054 * function qsort will accept 64-bit values for len & isize in 00055 * 64 bit mode. 00056 */ 00057 #include <stdlib.h> 00058 00059 extern void 00060 qsort_ (void *array, int *len, int *isize, 00061 int (*compar)(const void *, const void *)) 00062 { 00063 qsort(array, (size_t)*len, (size_t)*isize, compar); 00064 } 00065 00066
1.5.6