/* * Copyright 1986, 1987, 1988, 1989, 1990 Ithaca Software, Alameda, CA * */

#ifndef _1568

#define HOOPS_VERSION	220		/* _7266, 2.20 */
#define BETA_TEST		FALSE

/* _11452 _9675:  _3497, _3406, _3071, _1581, _1755, _2362, _4414 _2186 _4504 
   _8839 _10718 */

/* _4519 _11452 *_4880'_10721* _5802 _10866... */
#define null	0L

/* ... _4414 _10829 _11452 *_4880* _5802 _10349-_9351... */
#define FLOAT	float

/* _4414 _11452 *_8123* _4880'_10721 _5802 _10847... */
#ifndef __STDC__
#	define		volatile		/* _9810 _11399/_8622 */
#	define		const
#	ifndef THINK_C
#		define	void	int		/* _10699 _6225 _7309 _3284 */
#	endif
#endif

#ifdef	lint
/*#	  _11120	_8648*/
/*#	  _5606		_8648	(_11386 *)0*/
#	undef		FLOAT
#	define		FLOAT	double	/* _11408 _7876 _11182 _8807 _877 * -> _6567 * */
#else
#ifdef applec
#	define		MAC
#	undef		void
#	undef		null
#	define		null	(void *)0
#	ifndef		POSTSCRIPT
#		define	POSTSCRIPT
#	endif
#	undef		FLOAT	
#	define		FLOAT	_6333	 /* _2182 _4800 _4504 _8714 3.1 */
#else
#ifdef THINK_C
#	define		MAC
#	undef		null
#	define		null	(void *)0
#	ifndef		POSTSCRIPT
#		define	POSTSCRIPT
#	endif
#else
#ifdef	vms
#	define		VMS	   /* (_8121 _4627 _3657 _4414/_8864 _3400) */
#	ifndef		__STDC__		/* _7267 _10852 _6888 _11474... */
#		undef	volatile		/* _11176 _10840 */
#		undef	const
#		undef	void
#	endif
#	ifndef		const	/* '_5243' _4912 _8591-_10280 _4323 _7309 */
#		define	const	/* _5102 _10443, _10409 _5827'_10721 _5802 _7604. */
#	endif
#else
#ifdef	sun
#	define		SUN
#else
#ifdef	sgi
#	ifndef		IRIS
#		define	IRIS
#	endif
#else
#ifdef	apollo
#	define		APOLLO
#	define		const
#else
#ifdef	sony
#	ifndef		X11
#		define	X11
#	endif
#	define		SONY
#else
#ifdef	ultrix
#	ifndef		X11
#		define	X11
#	endif
#	define		ULTRIX
#else
#ifdef	OS2		/* _6698 _5168 _7842 */
#	undef		void					/* _8610 _10667 _4215 _10847 _10259... */
#	undef		null
#	define		null	(void *)0
#	define		const
#	ifndef		PM
#		define	PM
#	endif
#else
#ifdef	__HIGHC__
#	define		MW
#	undef		void
#	undef		null
#	define		null	(void *)0
#	define		const /* _8019 _7604 _4627 _10605 */
#else
#ifdef	hpux
#	define		HPUX
#	ifndef		X11
#		define	X11
#	endif
#else
	}}}}}}		/* _6627 _6225 */
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif

#ifndef GEORGE	/* _4406, _6625 _8633 */
#	define		GEORGE	1
#endif	

#ifdef	EBCDIC
	/* _1699 _8608 _5823 _4390 _4365 _7621 _11576 _7309 _6081, _7267 _6081 _7586
	 * _11464 _11452 _6888. _1900 _4414 _271, _7178, _4481 _4406 _50.
	 */
#	define		_3307(c)		_HTOAS[UNSIGNED_CHARTOINT(c)]
	extern		const char		_HTOAS[256];
#else
#	define		_3307(c)		(c)
#endif

#define true			((boolean)-1)
#define false			((boolean)0)
#define TRUE			(-1)	/* (_6625 _9368) */
#define FALSE			0
typedef int				boolean;
#define _8653	(void (*)())0	/* _8610 _10831 _10000 _4504 _8648! */


#define _32				128
#define _33				2
#define _345			128
#define _355	64
#define _574 (MAX_DRIVER_OPTIONS * 2)
#define _890	4
#define _923			FALSE			/**** _7695 ****/
#define _3060	50		/* _7863 _8714 _7440 */
#define _1323	8
#define _1340			FALSE	/* _6625 _3162 _3448 _96 _6225 _4970 */
#define _1728			FALSE
#define MAX_DRIVER_OPTIONS		32		/* _10954 _4278 _10831 _11586 (_8317 _8714 2) */
#define MAX_ERRMSG				200		/* (_8663 _8714 _4960) */
#define _2092			F(1e30)
#define _2093			30
#define _2106			500		/* (_8663 _8714 _4960) */
#define MAX_SHORT				0x7FFF	   /* _8218 _4409 _4365 _8003 */
#define _2101			0x7FFFFFFF /* _8218 _4409 _4365 _8003 */
#define _2097					(sizeof(int) == sizeof(long) ? _2101 : MAX_SHORT)
#define _2081			_2097
#define _2129	8
#define _2441	FALSE
#define _2442	FALSE
#define _2735	32
#define _2736			300		/* _4841 - _2283 _310 _231 _36! */
#define _2920	8
#define _2963	16
#define _2967			TRUE	/* _10334 _7825 */
#define _3035			F(1e15)
#define _3100 8
#define _3276	8
#define _3428	64		/* ? _6960 _7604! */
#define _3470	8

#define F(x)			((FLOAT)(x))
#define ADDR(x)			(x)
#define until(x)		while(!(x))
#define global			/* (_5598) */
#define globaldata		/* (_5598) */
#define local			static	/* _7909 _5502 _10293 _4627 '_5243' _10941! */
#define _7428			static
#define stack			/* */
#define forever			until (1 == 2)
#define countof(x)		(sizeof(x)/sizeof(x[0]))
#define _8582			/* (_6384 _10881 -- _7483 _8714 _4759) */

/* _11265 _10602 */

#define SETNAME(x)		(OUR (_5435) = x)
#define PUSHNAME()		(*OUR (_5437) = OUR (_5435),\
						 ++OUR (_5437)) /* (2 _9157 _6625 _2575) */
#define POPNAME()		(OUR (_5435) = *--OUR (_5437))

#define MIN(a, b)		((a) < (b) ? (a) : (b))
#define MAX(a, b)		((a) > (b) ? (a) : (b))
#define ABS(a)			((a) < 0 ? -(a) : (a))
#define FABS(a)			((a) < F(0) ? -(a) : (a))
#define FLOOR(a)		((a) > F(0) || (FLOAT)(int)(a) == (a) ? (int)(a) : \
																(int)(a) - 1)
#define CEILING(a)		((a) < F(0) || (FLOAT)(int)(a) == (a) ? (int)(a) : \
																(int)(a) + 1)
#define BIT(v, mask)	(((v) & (mask)) != 0)
#define _2965(c)		(((int)(char)-1 == -1) ? \
								 (int)(char)(c) : \
								 (UNSIGNED_CHARTOINT(c) & 0x80) ? \
								 127 - UNSIGNED_CHARTOINT(c) : \
								 UNSIGNED_CHARTOINT(c))
#define UNSIGNED_CHARTOINT(c)	(((int)(unsigned char)0xFF == 0xFF) ? \
						 (int)(unsigned char)(c) : (0xFF & (int)(c))) 
#define TOLOWER(c)		_HTOLO[UNSIGNED_CHARTOINT(c)]
#define ALLBITS(v, mask) (((v) & (mask)) == (mask))
#define ANYBIT(v, mask) (((v) & (mask)) != 0)
#define WHICHBIT(m) (m>>15?15:m>>14?14:m>>13?13:m>>12?12:m>>11?11:m>>10?10: \
			   m>>9?9:m>>8?8:m>>7?7:m>>6?6:m>>5?5:m>>4?4:m>>3?3:m>>2?2:m>>1?1:0)
extern	const char		_HTOLO[256];
#define _723(a,b)		((a).length == (b).length && \
								 HC_1372 (&(a), &(b)) == 0)

#if		_2967
	/*** _4521 _4153 _9267 _11503 _6541 _7309 _4153 _7940 ***/
#	define		_2581(p)						((long)p)
#	define		_1893(key)						((Anything *)key)
#else
}}}}}}	/* _6627 _6225 */
#endif

/* _4708 _7038 _4635 _10493 _6698 _10831 _6612 _10929 _10008 _6312 _10443 */
#define ALLOC(p, type)	_3462 (p, sizeof(type), type *)
#define VALLOC(p, size, type)	_3462 (p, size, type *)
#define _3462(p, size, _11054)									\
   (size > _2736 ? (p = (_11054)HI_Allocate((long)(size)), 0) : \
	((p = (_11054)OUR(_6690[_2972(size)])) == null ?	\
		  (p = (_11054)HI_QAllocate(_2972(size)), 0) : 0,				\
	 OUR (_6690[_2972(size)]) = ((_990*)p)->next, 0))

#define FREE(p, type)	_3465 (p, sizeof(type), type *)
#define VFREE(p, size, type)	_3465 (p, size, type *)
#define _3465(p, size, _11054)									\
   (size > _2736 ?										\
	(HI_Free ((void *)(_11054)p, (long)(size)), 0) :					\
	 (((_990 *)p)->next = OUR(_6690[_2972(size)]),		\
	   OUR (_6690 [_2972(size)]) = (_990 *)p, 0))

#define NAMEFREE(name)	\
	((name).length > 0 ? (VFREE((name).text, (name).length, char), 0) : 0)

#define _2972(size)		(((int)size-1)>>_33)
#define _2737	(_2972(_2736)+1) /* _7398'_5482 _7309 _237! */

typedef unsigned short	Color_Index;

typedef struct point {
	FLOAT				x, y, z;
}		Point;

typedef struct plane {
	FLOAT				a, b, c, d;
}		_2695;

typedef struct _11255 {
	float				x, y, z;
}		_3457;

typedef struct box {
	FLOAT				left, right, bottom, top;
}		Rectangle;

typedef struct hls {
	FLOAT				hue, lightness, saturation;
}		HLS;

typedef struct rgb {
	FLOAT				red, green, blue;
}		RGB;

typedef short	_2307;
typedef struct name {
	_2307				length;
	char				*text;
}		Name;
#define _2258(s)				{sizeof(s)-1, s}   /* _7415 _6625 _4153 '_2306' */

typedef struct _5245 {
	const short			length;
	const char			* const text;
}		_449;

/* "_1900" _4481 _6334 16-_4683 (_8864 _8267) _4960. _1767 _10831 _11206
 * _4839(_9991) _4481 _4365 _11862, _10831 _4957 _5102 _7586 _127, _7309 _10831 _7969
 * _4841. _1767 _10831 _11206 _7595'_10721 _4365 _11862, _10842 _7604'_9991 _10426 _6144,
 * _7834 _1898.
 */

typedef short			Karacter;

typedef struct _7697 {
	short				length;
	Karacter			*_7705;
}		_1897;

typedef struct _6684 {
	struct _6684		*next;
}		_990;

typedef long			Time;
#define HERTZ			60				/* _10886 _9113 _10132 */
#define TIME(_10130)	((Time)(HERTZ*(_10130)))  /* _3115 _10929 _10886 */
#define POLL_INTERVAL	TIME(1./24.)
#define INTERRUPT_INTERVAL		POLL_INTERVAL

typedef char			_3384;

typedef struct _4638 {
	struct {
		union _7140				*_6738,
								*_9054;
		short					utility;
		_3384					type;
		char					flags;
		struct _11585			*owner;
	}					h;
}		_240;

typedef int				_773;

#define _2087	32767
				
typedef struct _11585 {
	struct {
		struct _11585			*next,
								**_4577;
		short					utility;
		_3384					type;
		char					dbflags;		/* (_8079 _3149 _5515) */
		void					*owner;			/* _7018 */
	}							h;

	int							_7164;

	boolean						_10528;
	boolean						_8571;

	struct _6684				*_6690[_2737];

	struct open_list			*open_list;
	struct driver				*driver_list;
	struct segment				*root;

	union _7140			*_7732,
								*_7721;
	struct _4638				_4638;
	struct _8152				*_8153;

	struct _7000				*_6229,
								*_6300;
	struct _7000				*_6231;
	boolean						_6302;
	char						_10482[MAX_ERRMSG];
	char						*_5435,
								*_5439[20], /* (20 _7586 _7716!) */
								**_5437;

	Name						fortran_bufs[6];

	struct _5124				*_5125;
	struct color_name			**_5131;
	struct _4353				**_4355;
	struct _8857				**_7097,
								**_5258,
								**_6005,
								**_8181,
								**_10175,
								**_10713,
								**_10817,
								**_11253,
								**_11349;
	int							_8532;
	int							_8544;

	const char					*_8613; /* (_9848 _4321) */

	struct wakeup				*_11411;
	void						*system_time_data; /* _10140 _1782 _3368 */
	Time						_7763;
	boolean						_9828;
	int							_10897;
	volatile boolean			timer_expired;
	void						(*_6249)();
	union event					*_6257,
								*_8471,
								*_5423;

	boolean						(*_7066)();
	void						(*_7107)();
	boolean						(*_7052)();
	boolean						(*_7054)();
	void						(*_7109)();
	void						(*_7111)();

	struct _10125		*_10160,
								*_5260,
								*_4357,
								*_5135,
								*_8832,
								*_6619;

	boolean						_11192;
	boolean						_11197;
	int							update_suspensions;
	int							_11199; /* _11245 _7309 _3450 */
	struct _8178				*_8183;

	void						*system_specific_data;

	/* _10707 _8859... */
	_773						error_mask;
	boolean						_5267;
	int							_393;
	Name						_4461;
	int							_8171,
								messages_given;
	int							debug;

	/* _8280 _10847 _11182! */
	struct _8857				**_6617;
	boolean						(*_7056)();
	struct _8857				**_10300;
	boolean						(*_7058)();

	/* _5017 & _6142 */
	void						(*_7060)();
	void						(*_7062)();
	void						(*_7064)();
	void						(*_7068)();
}		_3651;

#define HC_1538()		(++OUR(update_suspensions))
#define HC_1506()		(--OUR(update_suspensions) == 0 && \
								 OUR(_5267) && OUR(_11197) ?\
								 (HC_Update_Display(), 0) : 0)

/* _8727-_9739 _7512 _9969 */

extern	void			*HI_Allocate(),
						*HI_QAllocate();
extern	char			*HI_Sprintf4();

extern	boolean			HI_Equal_Strings(),
						HI_Equal_Strings_To_Max();
extern	int				HI_String_Length();
extern	char			*HI_First_Substring_In_String(),
						*HI_Last_Substring_In_String();


#define Sprintf_D(buf,_10457,a)			 HI_Sprintf4(buf,_10457,a,0,null,null)
#define Sprintf_S(buf,_10457,a)			 HI_Sprintf4(buf,_10457,0,0,(void*)a,null)
#define Sprintf_P(buf,_10457,a)			 HI_Sprintf4(buf,_10457,0,0,(void*)a,null)
#define Sprintf_N(buf,_10457,a)			 HI_Sprintf4(buf,_10457,0,0,(void*)a,null)
#define Sprintf_F(buf,_10457,a)			 HI_Sprintf4(buf,_10457,0,0,(void*)&a,null)
#define Sprintf_LD(buf,_10457,a)		 HI_Sprintf4(buf,_10457,0,0,(void*)&a,null)
#define Sprintf_X(buf,_10457,a)			 HI_Sprintf4(buf,_10457,0,0,(void*)&a,null)
#define Sprintf_NN(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_FF(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)&a,(void*)&b)
#define Sprintf_SS(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_SD(buf,_10457,a,b) HI_Sprintf4(buf,_10457,b,0,(void*)a,null)
#define Sprintf_ND(buf,_10457,a,b) HI_Sprintf4(buf,_10457,b,0,(void*)a,null)
#define Sprintf_SP(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_PS(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_SN(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_NS(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_PP(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_PN(buf,_10457,a,b) HI_Sprintf4(buf,_10457,0,0,(void*)a,(void*)b)
#define Sprintf_DD(buf,_10457,a,b) HI_Sprintf4(buf,_10457,a,b,null,null)


/* _6865 _6545 _5502 (_10647 _4504 _7604 _7586) */

extern	_3651			_HOOPS;
#define OUR(_11465)		_HOOPS._11465
#define _3424()			(&_HOOPS)

typedef long			Type_Flags;
typedef int				Heuristics_Flags;
typedef short			Activity;
typedef int				Button;

/* _1773 _4905 _606._6975 _7586 _8402 _1777: */
#define Segment			struct segment
#define Camera			struct camera
#define Driver			struct driver
#define Event			union event
#define Anything		union _4436
#define Generic_Color	struct _6783
#define Modelling_Matrix struct modelling_matrix
#define Option_Value	struct option_value
#define Polygon			struct polygon

#define _3101			01
#define _3102	02
#define SYS_DEBUG_BREAK_TO_DEBUGGER		04

/* _10831 _6612 _11592 _8608 _4627 _7309 _5506._6975, _4817 _9484 _7094 
 * _6625 _10831 _6012.
 */
/* _2201 _2076 _3251 _1712 _3178! */
typedef int		Generic_Font_Name;
typedef char	Font_Transform,
				Font_Size_Units;
#define _1041			(Generic_Font_Name)0
#define _1047	(Generic_Font_Name)1
#define GFN_SANS_SERIF			(Generic_Font_Name)2
#define GFN_TYPEWRITER			(Generic_Font_Name)3
#define GFN_ROMAN				(Generic_Font_Name)4
#define _1046			(Generic_Font_Name)5
#define _1043			(Generic_Font_Name)6 /* _6625 _11234 _7309 _6012 */
#define GFN_LAST_GFN			_1043

#define _1568
#endif

/* (_8328'_10721 _6163 _11561 _4153 '#' _7842) */
