/*
	File:		Retrace.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 __RETRACE__
#define __RETRACE__

#ifndef __TYPES__
#include <MacTypes.H>
#endif

#ifndef __OSUTILS__
#include <OSUtils.H>
#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

typedef struct VBLTask VBLTask, *VBLTaskPtr;


/*
	VBLProcs cannot be written in or called from a high-level language without
	the help of mixed mode or assembly glue because they use the following
	parameter-passing convention:

	typedef pascal void (*VBLProcPtr)(VBLTaskPtr vblTaskPtr);

		In:
			=>	vblTaskPtr			A0.L
		Out:
			none
*/

enum  {
	uppVBLProcInfo			= kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterA0,kFourByteCode)
};

#if USESROUTINEDESCRIPTORS
typedef void (pascal *VBLProcPtr)(VBLTaskPtr vblTaskPtr);

typedef UniversalProcPtr VBLUPP;

#define CallVBLProc(userRoutine, vblTaskPtr)  \
	CallUniversalProc((UniversalProcPtr)(userRoutine), uppVBLProcInfo, (vblTaskPtr))

#define NewVBLProc(userRoutine)  \
	(VBLUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppVBLProcInfo, GetCurrentISA())

#else
typedef ProcPtr VBLUPP;

#define NewVBLProc(userRoutine)  \
	(VBLUPP)(userRoutine)

#endif

struct VBLTask {
	QElemPtr			qLink;
	short			qType;
	VBLUPP			vblAddr;
	short			vblCount;
	short			vblPhase;
};
#ifdef __cplusplus
extern "C" {
#endif

#if USESCODEFRAGMENTS
extern QHdrPtr pascal GetVBLQHdr(void);
#else
#define GetVBLQHdr() ((QHdrPtr) 0x0160)

#endif


extern OSErr pascal SlotVInstall(QElemPtr vblBlockPtr, short theSlot);

extern OSErr pascal SlotVRemove(QElemPtr vblBlockPtr, short theSlot);

extern OSErr pascal AttachVBL(short theSlot);

extern OSErr pascal DoVBLTask(short theSlot);

extern OSErr pascal VInstall(QElemPtr vblTaskPtr);

extern OSErr pascal VRemove(QElemPtr vblTaskPtr);
#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

#ifdef __cplusplus
}
#endif

#endif


