/****Copyright (c) 1997-2005 All rights reserved
 ****A. V. Gerbessiotis 
 ****Permission to use, copy, modify, and distribute this software,
 ****and to incorporate it, in whole or in part, into 
 ****other software,is hereby granted without fee, provided that
 ****  (1) the above copyright notice and this permission 
 ****      notice appear in all copies of the source code, and 
 ****      the above copyright notice appear in clearly visible 
 ****      form on all supporting documentation and distribution 
 ****      media, and
 ****     (2) any redistribution of the software, in original
 ****         or modified form, be without fee and subject to
 ****         these same conditions.
 ****   No guarantee, whatsoever, is offered that the code works as
 ****   advertised or is absent of any, even damaging,
 ****   side-effects. Use this code at your own personal risk.
 ****/

#include <memory.h>
#include <limits.h>
#include <string.h>

#ifndef TRUE
#define TRUE            1
#endif
#ifndef FALSE
#define	FALSE		0
#endif
#ifndef MIN
#define	MIN(x,y)	((x)<=(y)?(x):(y)) 
#endif
#ifndef MAX
#define	MAX(x,y)	((x)>=(y)?(x):(y))
#endif
#ifndef CEIL
#define CEIL(X,Y)       ((X != 0)?(1+ (X-1)/Y):0)  
#endif
#ifndef FLOOR
#define FLOOR(X,Y)      (X/Y)  
#endif
#define OLD_CEIL(X,Y)   ((((X/Y)*Y)==X)?(X/Y):(X/Y+1))  
#define LEFT(x,y)       (x-(x/y)*y)
#define         Div2(x)              ((x) >> 1)
#define         Times2(x)            ((x) << 1)
#define         CDiv(x, y)           (((x) != 0)?((((x) - 1)/(y))+1):0)
#define         Mask(x, sbit, nbits) ((x >> sbit) & ~(UINT_MAX << nbits))

void i32rdx2(unsigned int *, int); /* Two  round radix-65536 32-bit unsigned int sorting */
void i32rdx4(unsigned int *, int); /* Four round radix-256   32-bit unsigned int sorting */
void i32rdx (unsigned int *, int); /* 32-bit unsigned int sorting, Algorithm decides on rounds */

int FLog2 (int ); /* in ilogexp.c */
int CLog2 (int );
int Exp2  (int );

void check_if_null(void *, char *, char *); /* in inulchk.c */

/*
int compare(const void  *left,const void *right);
*/
