/* common.h		Fri Nov 18 13:57:44 1988 elsj, Author
 *
 * Description:	Common header file.
 *
 */

#ifndef _common_h_
#define _common_h_


/*  NULL pointer  */

#ifndef NULL
#define NULL 0
#endif


/*  End Of String character  */

#define	EOS '\0'


/*  Booleans  */

typedef int Bool;

#ifndef	TRUE
#define	TRUE 1
#endif

#ifndef	FALSE
#define	FALSE 0
#endif


/*  Infinite loop macro  */

#define	forever	while (1)


/*  Memory allocation macros  */

#define	New(type)		((type *)malloc(sizeof(type)))
#define	NewArray(type, n)	((type *)malloc(sizeof(type) * (n)))
#define	NewPtrArray(type, n)	((type **)malloc(sizeof(type*) * (n)))
#define	NewString(s)		(strcpy(malloc(strlen((s))+1), (s)))
#define	Delete(object)		((void)((object)!=0?free((char*)(object)):0))

extern	char*	malloc();
extern	int	free();


/*  Simple min, max macros  */

#define	min(a, b)		(((a)<(b))?(a):(b))
#define	max(a, b)		(((a)>(b))?(a):(b))


#endif	/* ndef _common_h_ */

