/*
 * Name:	MicroEMACS Version:	MG 2a Commodore Amiga system header
 * file.
 */

#undef	AZTEC
#undef	LATTICE
#undef	MANX
#include "compiler.h"

/*
 * ANSI means we have an ANSI-compliant compiler, and need a tweak for
 * alloca.
 */
#ifdef	LATTICE
#define	ANSI
#define STACK_DIRECTION	-1
#define	C_ALLOCA	1	/* To clean up some excess memory */
#endif

#ifdef AZTEC
/* assumes Manx Aztec C v5.0 or greater */
#define ANSI
#define STACK_DIRECTION -1
#define C_ALLOCA      1
#undef LATTICE
#ifdef NO_PROTO
#undef NO_PROTO
#endif
#endif

#ifdef	MANX
#define NO_PROTO
extern char    *offset_dummy;	/* Manx 3.2 can't handle 0->	 */
#define OFFSET(type,member) \
 ((char *)&(((type *)offset_dummy)->member)-(char *)((type *)offset_dummy))
/* But Lattice can, as of 5.04 */
#endif

#define	GOOD	0		/* Good exit status.		 */
#define	SYSINIT	sysinit()	/* System-specific initialization */
#define SYSCLEANUP syscleanup()	/* System-specific cleanup	 */
#define MALLOCROUND(m)	(m+=7,m&=~7)	/* Round up to 8 byte boundary	 */
#ifndef	NULL
#define NULL	0		/* These are crass, but		 */
#endif
#define	EOF	-1		/* will work`			 */

/*
 * Macros used by the buffer name making code. Start at the end of the file
 * name, scan to the left until BDC1 (or BDC2, if defined) is reached. The
 * buffer name starts just to the right of that location, and stops at end of
 * string (or at the next BDC3 character, if defined). BDC2 and BDC3 are
 * mainly for VMS.
 */
#define	BDC1	':'		/* Buffer names.		 */
#define	BDC2	'/'

/*
 * Typedefs for internal key type and how big a region can be.
 */

typedef short   KCHAR;		/* type used to represent Emacs characters */
typedef long    RSIZE;		/* size of a region	 */

#define	MAXPATH	128		/* longest expected directory path	 */

#define	bcopy(src,dest,len) movmem(src,dest,len)
#ifdef MANX
#define bzero(dest, len) setmem(dest, len, (char) 0)
/* defined in amiga/ttyio.c only cause there isn't a better place */
#define bcmp(src1, src2, len) m_memcmp(src1, src2, len)
#else
#define bzero(dest, len) memset(dest, (char) 0, len)
#define bcmp(src1, src2, len) memcmp(src1, src2, len)
#endif

#ifndef	LATTICE
#define fncmp Strcmp
#else
#define fncmp stricmp
#endif

#define unlinkdir(s1) unlink(s1)
