/*=-=-=-=-=-=-=-=-=-=-=-  RCI/RCCL Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1987 by John E. Lloyd. Permission to use, distribute  *
 *	and copy is granted for non-commercial and research purposes only,  *
 *	providing the authors are acknowledged and this copyright notice is *
 *	displayed. The authors provide this software in hope that it will   *
 *	useful, but do not assume responsibility for its use.		    *
 *									    *
 *	This software was developed using the facilities of the McGill 	    *
 *	University Research Center for Intelligent Machines, Montreal,	    *
 *	Canada, for a project undertaken and supported by the RCA Advanced  *
 *	Technology Laboratories, Moorestown, New Jersey.		    *
 *									    *
 *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/

#ifndef _CDEFS_H_
#define _CDEFS_H_

#ifdef NULL
#undef NULL
#endif
#define NULL	0
#define NULLF	(int(*)())0

#define YES	1
#define NO	0
#define UNDEF   -1

#define genptr		void *	/* historical */
#ifdef vax
#define void int
#endif

#define ABS(x)		((x) < 0 ? -(x) : (x))
#define FABS(x)		((x) < 0.0 ? -(x) : (x))
#define NINT(x)		((int)(((x)<0) ? ((x)-0.5) : ((x)+0.5)))

#define ARGUMENT(s)	(strcmp(*argv, (s)) == 0)  /* for parsing arg lists */
#define ARRAY_SIZE(a)	(sizeof(a)/sizeof(a[0]))   /* # of array elements */
#define STRNCPY(s1,s2,n) ((s1)[(n)] = '\0', strncpy ((s1),(s2),(n)))

#define ALLOC(type)	((type *) malloc(sizeof(type)))
#define FREE(x)		free((char *)x)

#endif
