/*
	File:		Types.h

	Copyright:	© 1984-1993 by Apple Computer, Inc., all rights reserved.

	WARNING
	This file was auto generated by the interfacer tool. Modifications
	must be made to the master file.

*/

#ifndef __TYPES__
#define __TYPES__

#ifdef	_MSC_VER
#pragma warning( disable : 4237 )	// nonstandard extension used : 'false' keyword is reserved for future use
#endif

#ifndef __CONDITIONALMACROS__
#if LONG_FILENAMES
#include <ConditionalMacros.H>
#else
#include <Conditio.H>
#endif
#endif

#if PRAGMA_IMPORT
#pragma import on
#endif

#if PRAGMA_STRUCT_ALIGN
	#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
	#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
	#pragma pack(2)
#endif

#ifndef NULL
#define NULL 0

#endif

#define nil 0

#define noErr 0

typedef unsigned char Byte;

typedef signed char SignedByte;

typedef char *Ptr;


/*  pointer to a master pointer */

typedef Ptr *Handle;


/* fixed point arithmatic type */

typedef long Fixed;

typedef Fixed *FixedPtr;

typedef long Fract;

typedef Fract *FractPtr;

typedef Byte UInt8;

typedef char SInt8;

typedef unsigned short UInt16;

typedef signed short SInt16;

typedef unsigned long UInt32;

typedef signed long SInt32;

typedef UInt16 UniChar;


#ifdef THINK_C
struct extended80 {
	short			w[5];
};
typedef struct extended80 extended80;

#else
#ifdef applec
#ifdef mc68881
struct extended80 {
	short			w[5];
};
typedef struct extended80 extended80;

#else
typedef extended extended80;

#endif

#elif WINVER
typedef struct { long man[2]; short exp; } extended80;
typedef struct { long man[2]; short zero, exp; } extended96;
#else
struct extended80 {
	short			w[5];
};
typedef struct extended80 extended80;

#endif

#endif

#if WINVER
#include <WinTypes.H>
#endif

#ifdef applec
typedef long double float_t;
typedef long double double_t;
#elif powerc || WINVER
typedef float float_t;
typedef double double_t;
#ifndef EXTENDED_IS_64BIT
#ifdef WIN32	// MSVC2.0 does not support the long double type
#define	EXTENDED_IS_64BIT	1
#else
#define	EXTENDED_IS_64BIT	0
#endif
#endif
#endif

// The order of these fields has been reversed on Windows so that our
// wide support will work utilizing native __int64 on Windows 32.
struct wide {
#if WINVER
	unsigned long	lo;
	long			hi;
#else
	long			hi;
	unsigned long	lo;
#endif
};
typedef struct wide wide;

// The order of these fields has been reversed on Windows so that our
// wide support will work utilizing native __int64 on Windows 32.
struct UnsignedWide {
#if WINVER
	unsigned long	lo;
	unsigned long	hi;
#else
	unsigned long	hi;
	unsigned long	lo;
#endif
};
typedef struct UnsignedWide UnsignedWide;

#ifdef __MWERKS__
#if	!__option(bool)
enum  {
	false,
	true
};
#endif
#else
#if !(defined(__cplusplus) && (defined(__BORLANDC__) || _MSC_VER>=1100 || __MWERKS__))
enum  {
	false,
	true
};
#endif
#endif

typedef unsigned char Boolean;

enum  {
	v,
	h
};

typedef unsigned char VHSelect;

typedef long (*ProcPtr)();

typedef ProcPtr *ProcHandle;

#if !USESROUTINEDESCRIPTORS

/* Note: if USESROUTINEDESCRIPTORS is true, UniversalProcPtr and
		UniversalProcHandle are defined in MixedMode.h */

#if WINVER
typedef void (*UniversalProcPtr)( void );
typedef void (**UniversalProcHandle)( void );
#else
typedef ProcPtr UniversalProcPtr, *UniversalProcHandle;
#endif

#endif

typedef unsigned char Str255[256], Str63[64], Str32[33], Str31[32], Str27[28], Str15[16], *StringPtr, **StringHandle;


/*
	The commented out section below is how Length() used to be declared. Because
	of an interfacer tool limitation, we cannot output the Length virtual C++
	funtion. Instead of just defining the Length macro for both C and C++ and
	cluttering the namespace, we have decided to just add a new macro called
	StrLength.

#ifdef __cplusplus
inline unsigned char &Length(StringPtr string) { return (*string); }
#else
#define Length(string) (*(unsigned char *)(string))
#endif
*/

#define StrLength(string) (*(unsigned char *)(string))

typedef const unsigned char *ConstStr255Param;
typedef const unsigned char *ConstStringPtr;

typedef ConstStr255Param ConstStr63Param, ConstStr32Param, ConstStr31Param, ConstStr27Param, ConstStr15Param;


/* error code */

typedef SInt16	OSErr;
typedef SInt32	OSStatus;

typedef unsigned long OSType;

typedef OSType *OSTypePtr;

typedef unsigned long ResType;

typedef ResType *ResTypePtr;

typedef unsigned char Style;

typedef short ScriptCode;

typedef short LangCode;

struct Point {
	short			v;
	short			h;
#ifdef __cplusplus
 short& vh(VHSelect sel);
 const short& vh(VHSelect sel) const;
#endif
};
typedef struct Point Point;

typedef Point *PointPtr;

struct Rect {
	short			top;
	short			left;
	short			bottom;
	short			right;
#ifdef __cplusplus
#ifndef PowerPlant
 Point& topLeft();			// Selector for non-const Rects
 Point& botRight();			// Selector for non-const Rects
#endif
#endif
};
typedef struct Rect Rect;

typedef Rect *RectPtr;

typedef	unsigned long FourCharCode;

enum  {
	normal			= 0,
	bold			= 1,
	italic			= 2,
	underline			= 4,
	outline			= 8,
	shadow			= 0x10,
	condense			= 0x20,
	extend			= 0x40
};


/* Numeric version part of 'vers' resource */

struct NumVersion {
	unsigned char			majorRev;			/*1st part of version number in BCD*/
	unsigned char			minorAndBugRev;			/*2nd & 3rd part of version number share a byte*/
	unsigned char			stage;			/*stage code: dev, alpha, beta, final*/
	unsigned char			nonRelRev;			/*revision level of non-released version*/
};
typedef struct NumVersion NumVersion;


/* 'vers' resource format */

struct VersRec {
	NumVersion			numericVersion;			/*encoded version number*/
	short			countryCode;			/*country code from intl utilities*/
	Str255			shortVersion;			/*version number string - worst case*/
	Str255			reserved;			/*longMessage string packed after shortVersion*/
};
typedef struct VersRec VersRec;

typedef VersRec *VersRecPtr, **VersRecHndl;

#ifndef __MIXEDMODE__
#if LONG_FILENAMES
#include <MixedMode.H>
#else
#include <MixedMod.H>
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifndef F_PASCAL
#if MACVER
#define F_PASCAL( thetype ) pascal thetype
#elif defined(WIN32)
#define F_PASCAL( thetype ) thetype __stdcall /* __export */
#else
#define F_PASCAL( thetype ) thetype far pascal /* __export */
#endif

#endif

extern F_PASCAL(void) Debugger(void);
extern F_PASCAL(void) DebugStr(ConstStr255Param aStr);
extern F_PASCAL(void) Debugger68k(void);
extern F_PASCAL(void) DebugStr68k(ConstStr255Param aStr);
extern F_PASCAL(void) debugstr(char *aStr);
extern F_PASCAL(void) SysBreak(void);
extern F_PASCAL(void) SysBreakStr(ConstStr255Param debugStr);
extern F_PASCAL(void) SysBreakFunc(ConstStr255Param debugFunc);
#ifdef __cplusplus
}
#endif

#if PRAGMA_STRUCT_ALIGN
	#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
	#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
	#pragma pack()
#endif

#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif

#endif


