
{        ReqTools (V38) interface for HSPascal         }
{                                                      }
{ ReqTools is (C) Copyright 1991/1992 by Nico François }
{                                                      }
{  HSPascal interface v1.2 © 1992 by Gunter Indenhoek  }

Unit ReqTools;

Interface
Uses Exec,AmigaDOS,Intuition,Graphics,Init,Utility;

Const
	
	REQTOOLSNAME = 'reqtools.library';
	REQTOOLSVERSION = 38;

Type

{ for Dosnames like Dir, Fontnames, etc. }

	pString = ^tString;
	tString = String;

{ array to pass your arguments to EZRequestA() }

	argarray = array[0..31] of LongInt;

{ array to pass your flags to reqtools-requesters }

	preqtaglist = ^treqtaglist;

	treqtaglist = array[0..32] of tTagItem;

{ library - base }

	pReqToolsBase = ^tReqToolsBase;

	tReqToolsBase = 
		Record
			Lib_Node: pLibrary;
			Flags: ShortInt;
			Pad: Array[0..2] of ShortInt;
			SegList: BPTR;
			{ The following library bases may be read and used by your program }
			IntuitionBase: ^tIntuitionBase;
			GfxBase: ^tGfxBase;
			DOSBase: ^tDosLibrary;
			{ Next two library bases are only (and always) valid on Kickstart 2.0!
			  (1.3 version of reqtools also initializes these when run on 2.0) }
			GadToolsBase: pLibrary;
			UtilityBase: pLibrary;
		end;

Const

{ types of requesters, for rtAllocRequestA() }

	RT_FILEREQ = 0;
	RT_REQINFO = 1;
	RT_FONTREQ = 2;
	{ (V38) }
	RT_SCREENMODEREQ = 3;

{***********************
*                      *
*    File requester    *
*                      *
***********************}

type

{ structure _MUST_ be allocated with rtAllocRequest() }

	prtFileRequester = ^trtFileRequester;

	trtFileRequester = Record
		ReqPos: LongInt;
		LeftOffset: Integer;
		TopOffset: Integer;
		Flags: LongInt;
		{ OBSOLETE IN V38! DON'T USE! } Hook: pHook;
		Dir: pString; 			{ READ ONLY! Change with rtChangeReqAttrA()! }
		MatchPat: pString; 	{ READ ONLY! Change with rtChangeReqAttrA()! }
		DefaultFont: pTextFont;
		WaitPointer: LongInt;
		{ (V38) }
		LockWindow: LongInt;
		ShareIDCMP: LongInt;
		IntuiMsgFunc: pHook;
		reserved1: Integer;
		reserved2: Integer;
		reserved3: Integer;
		ReqHeight: Integer;		{ READ ONLY! Use RTFI_Height tag! }
		{ Private data follows! HANDS OFF }
	end;

{ returned by rtFileRequestA() if multiselect is enabled,
  free list with rtFreeFileList() }

	prtFileList = ^trtFileList;

	trtFileList = Record
		Next: prtFileList;
		StrLen: LongInt;		{ -1 for directories }
		Name: pString;
	end;

{***********************
*                      *
*    Font requester    *
*                      *
***********************}

{ structure _MUST_ be allocated with rtAllocRequest() }

	prtFontRequester = ^trtFontRequester;

	trtFontRequester = Record
		ReqPos: LongInt;
		LeftOffset: Integer;
		TopOffset: Integer;
		Flags: LongInt;
		{ OBSOLETE IN V38! DON'T USE! } Hook: pHook;
		Attr: tTextAttr; { READ ONLY! }
		DefaultFont: pTextFont;
		WaitPointer: LongInt;
		{ (V38) }
		LockWindow: LongInt;
		ShareIDCMP: LongInt;
		IntuiMsgFunc: pHook;
		reserved1: Integer;
		reserved2: Integer;
		reserved3: Integer;
		ReqHeight: Integer; { READ ONLY!  Use RTFO_Height tag! }
		{ Private data follows! HANDS OFF }
	end;

{*************************
*                        *
*  ScreenMode requester  *
*                        *
*************************}

{ structure _MUST_ be allocated with rtAllocRequest() }

	prtScreenModeRequester = ^trtScreenModeRequester;

	trtScreenModeRequester = Record
		ReqPos: LongInt;
		LeftOffset: Integer;
		TopOffset: Integer;
		Flags: LongInt;
		private1: LongInt;
		DisplayID: LongInt;		{ READ ONLY! }
		DisplayWidth: Integer;	{ READ ONLY! }
		DisplayHeight: Integer;	{ READ ONLY! }
		DefaultFont: pTextFont;
		WaitPointer: LongInt;
		LockWindow: LongInt;
		ShareIDCMP: LongInt;
		IntuiMsgFunc: pHook;
		reserved1: Integer;
		reserved2: Integer;
		reserved3: Integer;
		ReqHeight: Integer;		{ READ ONLY!  Use RTSC_Height tag! }
		DisplayDepth: Integer;	{ READ ONLY! }
		OverscanType: Integer;	{ READ ONLY! }
		AutoScroll: LongInt;		{ READ ONLY! }
		{ Private data follows! HANDS OFF }
	end;

{***********************
*                      *
*    Requester Info    *
*                      *
***********************}

{ for rtEZRequestA(), rtGetLongA(), rtGetStringA() and rtPaletteRequestA(),
   _MUST_ be allocated with rtAllocRequest() }

	prtReqInfo = ^ trtReqInfo;

	trtReqInfo = Record
		ReqPos: LongInt;
		LeftOffset: Integer;
		TopOffset: Integer;
		Width: LongInt;				{ not for rtEZRequestA() }
		ReqTitle: pString;			{ currently only for rtEZRequestA() }
		Flags: LongInt;				{ currently only for rtEZRequestA() }
		DefaultFont: pTextFont;		{ currently only for rtPaletteRequestA() }
		WaitPointer: LongInt;
		{ (V38) }
		LockWindow: LongInt;
		ShareIDCMP: LongInt;
		IntuiMsgFunc: pHook;
		{ structure may be extended in future }
	end;

{***********************
*                      *
*     Handler Info     *
*                      *
***********************}

{ for rtReqHandlerA(), will be allocated for you when you use
   the RT_ReqHandler tag, never try to allocate this yourself! }

	prtHandlerInfo = ^trtHandlerInfo;

	trtHandlerInfo = Record
		private1: LongInt;
		WaitMask: LongInt;
		DoNotWait: LongInt;
   	{ Private data follows, HANDS OFF }
	end;

Const

{ possible return codes from rtReqHandlerA() }

	CALL_HANDLER = $80000000;

{*************************************
*                                    *
*                TAGS                *
*                                    *
*************************************}

	RT_TagBase = TAG_USER;

{ *** tags understood by most requester functions *** }
{ Optional pointer to window }
	RT_Window = $80000001;
{ idcmp flags requester should abort on (useful for IDCMP_DISKINSERTED) }
	RT_IDCMPFlags = $80000002;
{ position of requester window (see below) - default REQPOS_POINTER }
	RT_ReqPos = $80000003;
{ signal mask to wait for abort signal }
	RT_LeftOffset = $80000004;
{ topedge offset of requester relative to position specified by RT_ReqPos }
	RT_TopOffset = $80000005;
{ name of public screen to put requester on (Kickstart 2.0 only!) }
	RT_PubScrName = $80000006;
{ address of screen to put requester on }
	RT_Screen = $80000007;
{ tagdata must hold the address of (!) an APTR variable }
	RT_ReqHandler = $80000008;
{ font to use when screen font is rejected, _MUST_ be fixed-width font!
   ( pTextFont , not pTextAttr )
   - default GfxBase^.DefaultFont }
	RT_DefaultFont = $80000009;
{ boolean to set the standard wait pointer in window - default FALSE }
	RT_WaitPointer = $8000000A;
{ (V38) char preceding keyboard shortcut characters (will be underlined) }
	RT_Underscore = $8000000B;
{ (V38) share IDCMP port with window - default FALSE }
	RT_ShareIDCMP = $8000000C;
{ (V38) lock window and set standard wait pointer - default FALSE }
	RT_LockWindow = $8000000D;
{ (V38) boolean to make requester's screen pop to front - default TRUE }
	RT_ScreenToFront = $8000000E;
{ (V38) Requester should use this font - default: screen font }
	RT_TextAttr = $8000000F;
{ (V38) call this hook for every IDCMP message not for requester }
	RT_IntuiMsgFunc = $80000010;
{ (V38) Locale ReqTools should use for text }
	RT_Locale = $80000011;

{ *** tags specific to rtEZRequestA *** }
{ title of requester window - english default "Request" or "Information" }
	RTEZ_ReqTitle = $80000014;
{ ($80000015) reserved }
{ various flags (see below) }
	RTEZ_Flags = $80000016;
{ default response (activated by pressing RETURN) - default TRUE }
	RTEZ_DefaultResponse = $80000017;

{ *** tags specific to rtGetLongA *** }
{ minimum allowed value - default MININT }
	RTGL_Min = $8000001E;
{ maximum allowed value - default MAXINT }
	RTGL_Max = $8000001F;
{ suggested width of requester window (in pixels) }
	RTGL_Width = $80000020;
{ boolean to show the default value - default TRUE }
	RTGL_ShowDefault = $80000021;
{ (V38) string with possible responses - english default " _Ok |_Cancel" }
	RTGL_GadFmt = $80000022;
{ (V38) optional arguments for RTGL_GadFmt }
	RTGL_GadFmtArgs = $80000023;
{ (V38) invisible typing - default FALSE }
	RTGL_Invisible = $80000024;
{ (V38) window backfill - default TRUE }
	RTGL_BackFill = $80000025;
{ (V38) optional text above gadget }
	RTGL_TextFmt = $80000026;
{ (V38) optional arguments for RTGS_TextFmt }
	RTGL_TextFmtArgs = $80000027;
{ (V38) various flags (see below) }
	RTGL_Flags = RTEZ_Flags;

{ *** tags specific to rtGetStringA *** }
{ suggested width of requester window (in pixels) }
	RTGS_Width = RTGL_Width;
{ allow empty string to be accepted - default FALSE }
	RTGS_AllowEmpty = $80000050;
{ (V38) string with possible responses - english default " _Ok |_Cancel" }
	RTGS_GadFmt = RTGL_GadFmt;
{ (V38) optional arguments for RTGS_GadFmt }
	RTGS_GadFmtArgs = RTGL_GadFmtArgs;
{ (V38) invisible typing - default FALSE }
	RTGS_Invisible = RTGL_Invisible;
{ (V38) window backfill - default TRUE }
	RTGS_BackFill = RTGL_BackFill;
{ (V38) optional text above gadget }
	RTGS_TextFmt = RTGL_TextFmt;
{ (V38) optional arguments for RTGS_TextFmt }
	RTGS_TextFmtArgs = RTGL_TextFmtArgs;
{ (V38) various flags (see below) }
	RTGS_Flags = RTEZ_Flags;

{ *** tags specific to rtFileRequestA *** }
{ various flags (see below) }
	RTFI_Flags = $80000028;
{ suggested height of file requester }
	RTFI_Height = $80000029;
{ replacement text for 'Ok' gadget (max 6 chars) }
	RTFI_OkText = $8000002A;
{ (V38) bring up volume requester, tag data holds flags (see below) }
	RTFI_VolumeRequest = $8000002B;
{ (V38) call this hook for every file in the directory }
	RTFI_FilterFunc = $8000002C;
{ (V38) allow empty file to be accepted - default FALSE }
	RTFI_AllowEmpty = $8000002D;

{ *** tags specific to rtFontRequestA *** }
{ various flags (see below) }
	RTFO_Flags = RTFI_Flags;
{ suggested height of font requester }
	RTFO_Height = RTFI_Height;
{ replacement text for 'Ok' gadget (max 6 chars) }
	RTFO_OkText = RTFI_OkText;
{ suggested height of font sample display - default 24 }
	RTFO_SampleHeight = $8000003C;
{ minimum height of font displayed }
	RTFO_MinHeight = $8000003D;
{ maximum height of font displayed }
	RTFO_MaxHeight = $8000003E;
{ [($8000003F) to ($80000042) used below] }
{ (V38) call this hook for every font }
	RTFO_FilterFunc = RTFI_FilterFunc;

{ *** (V38) tags for rtScreenModeRequestA *** }
{ various flags (see below) }
	RTSC_Flags = RTFI_Flags;
{ suggested height of screenmode requester }
	RTSC_Height = RTFI_Height;
{ replacement text for 'Ok' gadget (max 6 chars) }
	RTSC_OkText = RTFI_OkText;
{ property flags (see also RTSC_PropertyMask) }
	RTSC_PropertyFlags = $8000005A;
{ property mask - default all bits in RTSC_PropertyFlags considered }
	RTSC_PropertyMask = $8000005B;
{ minimum display width allowed }
	RTSC_MinWidth = $8000005C;
{ maximum display width allowed }
	RTSC_MaxWidth = $8000005D;
{ minimum display height allowed }
	RTSC_MinHeight = $8000005E;
{ maximum display height allowed }
	RTSC_MaxHeight = $8000005F;
{ minimum display depth allowed }
	RTSC_MinDepth = $80000060;
{ maximum display depth allowed }
	RTSC_MaxDepth = $80000061;
{ call this hook for every display mode id }
	RTSC_FilterFunc = RTFI_FilterFunc;

{ *** tags for rtChangeReqAttrA *** }
{ file requester - set directory }
	RTFI_Dir = $80000032;
{ file requester - set wildcard pattern }
	RTFI_MatchPat = $80000033;
{ file requester - add a file or directory to the buffer }
	RTFI_AddEntry = $80000034;
{ file requester - remove a file or directory from the buffer }
	RTFI_RemoveEntry = $80000035;
{ font requester - set font name of selected font }
	RTFO_FontName = $8000003F;
{ font requester - set font size }
	RTFO_FontHeight = $80000040;
{ font requester - set font style }
	RTFO_FontStyle = $80000041;
{ font requester - set font flags }
	RTFO_FontFlags = $80000042;
{ (V38) screenmode requester - get display attributes from screen }
	RTSC_ModeFromScreen = $80000050;
{ (V38) screenmode requester - set display mode id (32-bit extended) }
	RTSC_DisplayID = $80000051;
{ (V38) screenmode requester - set display width }
	RTSC_DisplayWidth = $80000052;
{ (V38) screenmode requester - set display height }
	RTSC_DisplayHeight = $80000053;
{ (V38) screenmode requester - set display depth }
	RTSC_DisplayDepth = $80000054;
{ (V38) screenmode requester - set overscan type, 0 for regular size }
	RTSC_OverscanType = $80000055;
{ (V38) screenmode requester - set autoscroll }
	RTSC_AutoScroll = $80000056;


{ *** tags for rtPaletteRequestA *** }
{ initially selected color - default 1 }
	RTPA_Color = $80000046;

{ *** tags for rtReqHandlerA *** }
{ end requester by software control, set tagdata to REQ_CANCEL, REQ_OK or
  in case of rtEZRequest to the return value }
	RTRH_EndRequest = $800003C;

{ *** tags for rtAllocRequestA *** }
{ no tags defined yet }

{************
* RT_ReqPos *
************}
	REQPOS_POINTER = 0;
	REQPOS_CENTERWIN = 1;
	REQPOS_CENTERSCR = 2;
	REQPOS_TOPLEFTWIN = 3;
	REQPOS_TOPLEFTSCR = 4;
	
{******************
* RTRH_EndRequest *
******************}
	REQ_CANCEL = 0;
	REQ_OK = 1;

{***************************************
* flags for RTFI_Flags and RTFO_Flags  *
* or filereq->Flags and fontreq->Flags *
***************************************}
	FREQB_NOBUFFER = 2;
	FREQF_NOBUFFER = 4;

{*****************************************
* flags for RTFI_Flags or filereq->Flags *
*****************************************}
	FREQB_MULTISELECT = 0;
	FREQF_MULTISELECT = 1;
	FREQB_SAVE = 1;
	FREQF_SAVE = 2;
	FREQB_NOFILES = 3;
	FREQF_NOFILES = 8;
	FREQB_PATGAD = 4;
	FREQF_PATGAD = 16;
	FREQB_SELECTDIRS = 12;
	FREQF_SELECTDIRS = 4096;

{*****************************************
* flags for RTFO_Flags or fontreq->Flags *
*****************************************}
	FREQB_FIXEDWIDTH = 5;
	FREQF_FIXEDWIDTH = 32;
	FREQB_COLORFONTS = 6;
	FREQF_COLORFONTS = 64;
	FREQB_CHANGEPALETTE = 7;
	FREQF_CHANGEPALETTE = 128;
	FREQB_LEAVEPALETTE = 8;
	FREQF_LEAVEPALETTE = 256;
	FREQB_SCALE = 9;
	FREQF_SCALE = 512;
	FREQB_STYLE = 10;
	FREQF_STYLE = 1024;

{*****************************************************
* (V38) flags for RTSC_Flags or screenmodereq->Flags *
*****************************************************}
	SCREQB_SIZEGADS = 13;
	SCREQF_SIZEGADS = 8192;
	SCREQB_DEPTHGAD = 14;
	SCREQF_DEPTHGAD = 16384;
	SCREQB_NONSTDMODES = 15;
	SCREQF_NONSTDMODES = 32768;
	SCREQB_GUIMODES = 16;
	SCREQF_GUIMODES = 65536;
	SCREQB_AUTOSCROLLGAD = 18;
	SCREQF_AUTOSCROLLGAD = 262144;
	SCREQB_OVERSCANGAD = 19;
	SCREQF_OVERSCANGAD = 524288;

{*****************************************
* flags for RTEZ_Flags or reqinfo->Flags *
*****************************************}
	EZREQB_NORETURNKEY = 0;
	EZREQF_NORETURNKEY = 1;
	EZREQB_LAMIGAQUAL = 1;
	EZREQF_LAMIGAQUAL = 2;
	EZREQB_CENTERTEXT = 2;
	EZREQF_CENTERTEXT = 4;

{***********************************************
* (V38) flags for RTGL_Flags or reqinfo->Flags *
***********************************************}
	GLREQB_CENTERTEXT = EZREQB_CENTERTEXT;
	GLREQF_CENTERTEXT = EZREQF_CENTERTEXT;
	GLREQB_HIGHLIGHTTEXT = 3;
	GLREQF_HIGHLIGHTTEXT = 8;

{***********************************************
* (V38) flags for RTGS_Flags or reqinfo->Flags *
***********************************************}
	GSREQB_CENTERTEXT = EZREQB_CENTERTEXT;
	GSREQF_CENTERTEXT = EZREQF_CENTERTEXT;
	GSREQB_HIGHLIGHTTEXT = GLREQB_HIGHLIGHTTEXT;
	GSREQF_HIGHLIGHTTEXT = GLREQF_HIGHLIGHTTEXT;

{*****************************************
* (V38) flags for RTFI_VolumeRequest tag *
*****************************************}
	VREQB_NOASSIGNS=0;
	VREQF_NOASSIGNS=1;
	VREQB_NODISKS=1;
	VREQF_NODISKS=2;
	VREQB_ALLDISKS=2;
	VREQF_ALLDISKS=4;

{*
   Following things are obsolete in ReqTools V38.
   DON'T USE THESE IN NEW CODE!
*}
	REQHOOK_WILDFILE=0;
	REQHOOK_WILDFONT=1;
	FREQB_DOWILDFUNC=11;
	FREQF_DOWILDFUNC=2048;


{************
* Functions *
************}

Function rtAllocRequestA
		 (type_: LongInt;
		  taglist: preqtaglist): LongInt;

Function rtFreeRequest (req: Pointer): LongInt;
Function rtFreeReqBuffer (req: Pointer): LongInt;
Function rtChangeReqAttrA
		 (req: Pointer;
		  taglist: preqtaglist): LongInt;

Function rtFileRequestA
		 (filereq: prtFileRequester;
		  file_: pString;
		  title: String;
		  taglist: preqtaglist): LongInt;

Function rtFreeFileList (filelist: prtFileList): LongInt;
Function rtEZRequestA
		 (bodyfmt:String;
		  gadfmt:String;
		  reqinfo: prtReqInfo;
		  argarray:Pointer;
		  taglist: preqtaglist): LongInt;

Function rtGetStringA
		 (buffer: Pointer;
		  maxchars: LongInt;
		  title: String;
		  reqinfo:prtReqInfo;
		  taglist: preqtaglist): LongInt;

Function rtGetLongA
		 (longptr: Pointer;
		  title: String;
		  reqinfo:prtReqInfo;
		  taglist: preqtaglist): LongInt;

Function rtFontRequestA
		 (fontreq:prtFontRequester;
		  title: String;
		  taglist: preqtaglist): LongInt;

Function rtPaletteRequestA
		 (title: String;
		  reqinfo:prtReqInfo;
		  taglist: preqtaglist): LongInt;

Function rtReqHandlerA
		 (handlerinfo: prtHandlerInfo;
		  sigs: LongInt;
		  taglist: preqtaglist): LongInt;

Function rtSetWaitPointer (window: pWindow): LongInt;
Function rtGetVScreenSize
		 (screen:pScreen;
		  widthptr,
		  heightptr: Pointer): LongInt;

Function rtSetReqPosition
		 (reqpos: LongInt;
		  newwindow:pNewWindow;
		  screen:pScreen;
		  window: pWindow): LongInt;

Function rtSpread
		 (posarray,
		  sizearray: Pointer;
		  length,
		  min,
		  max,
		  num: LongInt): LongInt;

Function rtScreenToFrontSafely (screen: pScreen): LongInt;
Function rtScreenModeRequestA
		 (screenmodereq:prtScreenModeRequester;
		  title: String;
		  taglist: preqtaglist): LongInt;

Function rtCloseWindowSafely (win: pWindow): LongInt;
Function rtLockWindow (win: pWindow): LongInt;
Function rtUnlockWindow
		 (win:pWindow;
		  winlock: Pointer): LongInt;

Var
  ReqToolsBase: pReqToolsBase;

Implementation

Function AllocRequestA
		 (type_: LongInt;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	lea	$8(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,d0
	move.l	ReqToolsBase,a6
	jsr	-$1E(a6)
	move.l	d0,$10(sp)
	move.l	(sp)+,a6
END;

Function FreeRequest (req: Pointer): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	move.l	$8(sp),a1
	move.l	ReqToolsBase,a6
	jsr	-$24(a6)
	move.l	d0,$C(sp)
	move.l	(sp)+,a6
END;

Function FreeReqBuffer (req: Pointer): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	move.l	$8(sp),a1
	move.l	ReqToolsBase,a6
	jsr	-$2A(a6)
	move.l	d0,$C(sp)
	move.l	(sp)+,a6
END;

Function ChangeReqAttrA
		 (req: Pointer;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	movem.l	$8(sp),a0-a1
	move.l	ReqToolsBase,a6
	jsr	-$30(a6)
	move.l	d0,$10(sp)
	move.l	(sp)+,a6
END;

Function FileRequestA
		 (filereq:prtFileRequester;
		  file_: Pointer;
		  title: Pointer;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	movem.l	a2-a3/a6,-(sp)
	lea	$10(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,a3
	move.l	(a6)+,a2
	move.l	(a6)+,a1
	move.l	ReqToolsBase,a6
	jsr	-$36(a6)
	move.l	d0,$20(sp)
	movem.l	(sp)+,a2-a3/a6
END;

Function FreeFileList (filelist: prtFileList): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	move.l	$8(sp),a0
	move.l	ReqToolsBase,a6
	jsr	-$3C(a6)
	move.l	d0,$C(sp)
	move.l	(sp)+,a6
END;

Function EZRequestA
		 (bodyfmt:Pointer;
		  gadfmt: Pointer;
		  reqinfo: prtReqInfo;
		  argarray: Pointer;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	movem.l	a2-a4/a6,-(sp)
	lea	$14(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,a4
	move.l	(a6)+,a3
	move.l	(a6)+,a2
	move.l	(a6)+,a1
	move.l	ReqToolsBase,a6
	jsr	-$42(a6)
	move.l	d0,$28(sp)
	movem.l	(sp)+,a2-a4/a6
END;

Function GetStringA
		 (buffer: Pointer;
		  maxchars: LongInt;
		  title: Pointer;
		  reqinfo: prtReqInfo;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	movem.l	a2-a3/a6,-(sp)
	lea	$10(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,a3
	move.l	(a6)+,a2
	move.l	(a6)+,d0
	move.l	(a6)+,a1
	move.l	ReqToolsBase,a6
	jsr	-$48(a6)
	move.l	d0,$24(sp)
	movem.l	(sp)+,a2-a3/a6
END;

Function GetLongA
		 (longptr:Pointer;
		  title:Pointer;
		  reqinfo:prtReqInfo;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	movem.l	a2-a3/a6,-(sp)
	lea	$10(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,a3
	move.l	(a6)+,a2
	move.l	(a6)+,a1
	move.l	ReqToolsBase,a6
	jsr	-$4E(a6)
	move.l	d0,$20(sp)
	movem.l	(sp)+,a2-a3/a6
END;

Function FontRequestA
		 (fontreq:prtFontRequester;
		  title: Pointer;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	movem.l	a3/a6,-(sp)
	lea	$C(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,a3
	move.l	(a6)+,a1
	move.l	ReqToolsBase,a6
	jsr	-$60(a6)
	move.l	d0,$18(sp)
	movem.l	(sp)+,a3/a6
END;

Function PaletteRequestA
		 (title:Pointer;
		  reqinfo: prtReqInfo;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	movem.l	a2-a3/a6,-(sp)
	lea	$10(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,a3
	move.l	(a6)+,a2
	move.l	ReqToolsBase,a6
	jsr	-$66(a6)
	move.l	d0,$1C(sp)
	movem.l	(sp)+,a2-a3/a6
END;

Function ReqHandlerA
		 (handlerinfo: prtHandlerInfo;
		  sigs: LongInt;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	lea	$8(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,d0
	move.l	(a6)+,a1
	move.l	ReqToolsBase,a6
	jsr	-$6C(a6)
	move.l	d0,$14(sp)
	move.l	(sp)+,a6
END;

Function SetWaitPointer (window: pWindow): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	move.l	$8(sp),a0
	move.l	ReqToolsBase,a6
	jsr	-$72(a6)
	move.l	d0,$C(sp)
	move.l	(sp)+,a6
END;

Function GetVScreenSize
		 (screen: pScreen;
		  widthptr,
		  heightptr: Pointer): LongInt;
XASSEMBLER;
ASM	movem.l	a2/a6,-(sp)
	lea	$C(sp),a6
	move.l	(a6)+,a2
	move.l	(a6)+,a1
	move.l	(a6)+,a0
	move.l	ReqToolsBase,a6
	jsr	-$78(a6)
	move.l	d0,$18(sp)
	movem.l	(sp)+,a2/a6
END;

Function SetReqPosition
		 (reqpos: LongInt;
		  newwindow: pNewWindow;
		  screen: pScreen;
		  window: pWindow): LongInt;
XASSEMBLER;
ASM	movem.l	a2/a6,-(sp)
	lea	$C(sp),a6
	move.l	(a6)+,a2
	move.l	(a6)+,a1
	move.l	(a6)+,a0
	move.l	(a6)+,d0
	move.l	ReqToolsBase,a6
	jsr	-$7E(a6)
	move.l	d0,$1C(sp)
	movem.l	(sp)+,a2/a6
END;

Function Spread
		 (posarray,
		  sizearray: Pointer;
		  length,
		  min,
		  max,
		  num: LongInt): LongInt;
XASSEMBLER;
ASM	movem.l	d3/a6,-(sp)
	lea	$C(sp),a6
	move.l	(a6)+,d3
	move.l	(a6)+,d2
	move.l	(a6)+,d1
	move.l	(a6)+,d0
	move.l	(a6)+,a1
	move.l	(a6)+,a0
	move.l	ReqToolsBase,a6
	jsr	-$84(a6)
	move.l	d0,$24(sp)
	movem.l	(sp)+,d3/a6
END;

Function ScreenToFrontSafely (screen: pScreen): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	move.l	$8(sp),a0
	move.l	ReqToolsBase,a6
	jsr	-$8A(a6)
	move.l	d0,$C(sp)
	move.l	(sp)+,a6
END;

Function ScreenModeRequestA
		 (screenmodereq: prtScreenModeRequester;
		  title: Pointer;
		  taglist: preqtaglist): LongInt;
XASSEMBLER;
ASM	movem.l	a3/a6,-(sp)
	lea	$C(sp),a6
	move.l	(a6)+,a0
	move.l	(a6)+,a3
	move.l	(a6)+,a1
	move.l	ReqToolsBase,a6
	jsr	-$90(a6)
	move.l	d0,$18(sp)
	movem.l	(sp)+,a3/a6
END;

Function CloseWindowSafely (win: pWindow): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	move.l	$8(sp),a0
	move.l	ReqToolsBase,a6
	jsr	-$96(a6)
	move.l	d0,$C(sp)
	move.l	(sp)+,a6
END;

Function LockWindow (win: pWindow): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	move.l	$8(sp),a0
	move.l	ReqToolsBase,a6
	jsr	-$9C(a6)
	move.l	d0,$C(sp)
	move.l	(sp)+,a6
END;

Function UnlockWindow
		 (win: pWindow;
		  winlock: Pointer): LongInt;
XASSEMBLER;
ASM	move.l	a6,-(sp)
	lea	$8(sp),a6	
	move.l	(a6)+,a1
	move.l	(a6)+,a0
	move.l	ReqToolsBase,a6
	jsr	-$A2(a6)
	move.l	d0,$10(sp)
	move.l	(sp)+,a6
END;

Function rtAllocRequestA
		 (type_: LongInt;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtAllocRequestA:=AllocRequestA(type_,taglist);
END;

Function rtFreeRequest (req: Pointer): LongInt;
BEGIN
 rtFreeRequest:=FreeRequest(req);
END;

Function rtFreeReqBuffer (req: Pointer): LongInt;
BEGIN
 rtFreeReqBuffer:=FreeReqBuffer(req);
END;

Function rtChangeReqAttrA
		 (req: Pointer;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtChangeReqAttrA:=ChangeReqAttrA(req,taglist);
END;

Function rtFileRequestA
		 (filereq: prtFileRequester;
		  file_: pString;
		  title: String;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtFileRequestA:=FileRequestA(filereq,file_,CstrConstPtr(title),taglist);
END;

Function rtFreeFileList (filelist: prtFileList): LongInt;
BEGIN
 rtFreeFileList:=FreeFileList(filelist);
END;

Function rtEZRequestA
		 (bodyfmt:String;
		  gadfmt:String;
		  reqinfo: prtReqInfo;
		  argarray:preqtaglist; { voorlopige oplossing }
		  taglist: preqtaglist): LongInt;
BEGIN
 rtEZRequestA:=EZRequestA(CstrConstPtr(bodyfmt),CstrConstPtr(gadfmt),reqinfo,argarray,taglist);
END;

Function rtGetStringA
		 (buffer: Pointer;
		  maxchars: LongInt;
		  title: String;
		  reqinfo:prtReqInfo;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtGetStringA:=GetStringA(buffer,maxchars,CstrConstPtr(title),reqinfo,taglist);
END;

Function rtGetLongA
		 (longptr: Pointer;
		  title: String;
		  reqinfo:prtReqInfo;
		  taglist: preqtaglist): LongInt;
BEGIN
  rtGetLongA:=GetLongA(longptr,CstrConstPtr(title),reqinfo,taglist);
END;

Function rtFontRequestA
		 (fontreq:prtFontRequester;
		  title: String;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtFontRequestA:=FontRequestA(fontreq,CstrConstPtr(title),taglist);
END;

Function rtPaletteRequestA
		 (title: String;
		  reqinfo:prtReqInfo;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtPaletteRequestA:=PaletteRequestA(CstrConstPtr(title),reqinfo,taglist);
END;

Function rtReqHandlerA
		 (handlerinfo: prtHandlerInfo;
		  sigs: LongInt;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtReqHandlerA:=ReqHandlerA(handlerinfo,sigs,taglist);
END;

Function rtSetWaitPointer (window: pWindow): LongInt;
BEGIN
 rtSetWaitPointer:=rtSetWaitPointer(window);
END;

Function rtGetVScreenSize
		 (screen:pScreen;
		  widthptr,
		  heightptr: Pointer): LongInt;
BEGIN
 rtGetVScreenSize:=GetVScreenSize(screen,widthptr,heightptr);
END;

Function rtSetReqPosition
		 (reqpos: LongInt;
		  newwindow:pNewWindow;
		  screen:pScreen;
		  window: pWindow): LongInt;
BEGIN
 rtSetReqPosition:=SetReqPosition(reqpos,newwindow,screen,window);
END;

Function rtSpread
		 (posarray,
		  sizearray: Pointer;
		  length,
		  min,
		  max,
		  num: LongInt): LongInt;
BEGIN
 rtSpread:=Spread(posarray,sizearray,length,min,max,num);
END;

Function rtScreenToFrontSafely (screen: pScreen): LongInt;
BEGIN
 rtScreenToFrontSafely:=ScreenToFrontSafely(screen);
END;

Function rtScreenModeRequestA
		 (screenmodereq:prtScreenModeRequester;
		  title: String;
		  taglist: preqtaglist): LongInt;
BEGIN
 rtScreenModeRequestA:=ScreenModeRequestA(screenmodereq,CstrConstPtr(title),taglist);
END;

Function rtCloseWindowSafely (win: pWindow): LongInt;
BEGIN
 rtCloseWindowSafely:=CloseWindowSafely(win);
END;

Function rtLockWindow (win: pWindow): LongInt;
BEGIN
 rtLockWindow:=LockWindow(win);
END;

Function rtUnlockWindow
		 (win:pWindow;
		  winlock: Pointer): LongInt;
BEGIN
 rtUnlockWindow:=UnlockWindow(win,winlock);
END;

End.
