/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2003-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#include "vchdr.h"
/* Like qsort() but allows a struct to hold add'l data describing objects.
**
** Written by Kiem-Phong Vo.
*/
} while(0)
#if __STD_C
#else
ssize_t n; /* number of objects in list[] */
#endif
{
ssize_t l, r;
if(n <= 1)
return;
if(n == 2)
return;
}
for(l = 1, r = n; l < r; ) /* pivot on element 0 */
l += 1;
else if((r -= 1) > l)
}
if((l -= 1) > 0) /* move the pivot into its final place */
if(l > 1)
if((n -= r) > 1)
}