/* begincopyright
  Copyright (c) 1988 Xerox Corporation. All rights reserved.
  Use and copying of this software and preparation of derivative works based
  upon this software are permitted. Any distribution of this software or
  derivative works must comply with all applicable United States export
  control laws. This software is made available AS IS, and Xerox Corporation
  makes no warranty about the software, its performance or its conformity to
  any specification. Any person obtaining a copy of this software is requested
  to send their name and post office or electronic mail address to:
    PCR Coordinator
    Xerox PARC
    3333 Coyote Hill Rd.
    Palo Alto, CA
  endcopyright */
/*
 * BasicTypes.h
 *
 * Demers, March 31, 1990 10:42:34 pm PST
 */


#ifndef	←XR←BASIC←TYPES←
#define ←XR←BASIC←TYPES← 1

/* NIL pointer */

#ifdef NIL
# if NIL != 0
    --> ERROR <--
# endif
# undef NIL
#endif
#define NIL	0

/* Boolean values */

#undef bool
#define bool	long

#ifdef FALSE
# if FALSE != 0
    --> ERROR <--
# endif
# undef FALSE
#endif
#define FALSE	0

#ifdef TRUE
# if TRUE != 1
    --> ERROR <--
# endif
#undef TRUE
#endif
#define	TRUE	1


/*
 * Big/Little Endian stuff ...
 */

#if defined(sparc) || defined(mc68020)
#   define BE16ToShort(dp)	(*((short *)(dp)))
#   define ShortToBE16(x, dp)	(*((short *)(dp)) = (x))
#   define BE32ToLong(dp)	(*((long *)(dp)))
#   define LongToBE32(x, dp)	(*((long *)(dp)) = (x))
#else
 --> fix me for little-endian machines <--
#endif

/*
 * poor substitute for void*
 */

typedef unsigned XR←Pointer;

/*
 * Mesa procedure
 */

typedef XR←Pointer (*XR←UntypedProc)(/* ..., XR←MesaProc self */);

typedef struct XR←MesaProcRep {
    XR←UntypedProc mp←proc;
    XR←Pointer mp←x;
} * XR←MesaProc;


extern XR←MesaProc
XR←MakeMesaProc(/* XR←UntypedProc proc, XR←Pointer x */);

#endif ←XR←BASIC←TYPES←