/* 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_