/* * Creation Date: <2002/10/19 21:05:07 samuel> * Time-stamp: <2002/10/22 22:29:18 samuel> * * * * Miscellaneous * * Copyright (C) 2002, 2003 Samuel Rydh (samuel@ibrium.se) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation * */ #include "openbios/config.h" #include "libc/string.h" int errno_int; void qsort( void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void*) ) { unsigned int worked, i, j; /* even more inefficient than the glibc variant :-) */ do { char *p = base; worked = 0; for( i=0; i 0 ) { worked = 1; for( j=0; j= base || n < 0 ) break; sum *= base; sum += n; } if( endptr ) *endptr = (char*)nptr; return sum * sign; }