/*																				*/
/*									advm.h									*/
/*			general purpose macros										*/
/*																				*/

#include <assert.h>

#ifndef stderr
#include <stdio.h>
#endif

/* this define a macro for asserting good array subsrcipts  */

#define array(a_name,a_size)	assert(((a_size)>=0) && ((a_size) < sizeof(a_name)/sizeof(a_name[0])))
#define array2(a_name,a_size1,a_size2)	assert(((a_size1)>=0) && \
													((a_size2)>=0) && \
													((a_size1) < sizeof(a_name)/sizeof(a_name[0])) && \
													((a_size2) < sizeof(a_name)/(sizeof(a_name[0][0])*(sizeof(a_name)/sizeof(a_name[0])))) )

#define TRUE	-1
#define FALSE	0

#ifdef TRACE

#define trace(s)					printf(s)
#define trace1(s,a)				printf(s,a)
#define trace2(s,a,b)			printf(s,a,b)
#define trace3(s,a,b,c)			printf(s,a,b,c)

#else

#define trace(s)
#define trace1(s,a)
#define trace2(s,a,b)
#define trace3(s,a,b,c)

#endif

