;
; saveAs.sh
;
; Implementation of a save as dialogue box
;
;  1994-1998 Straylight
;

;----- Licensing note -------------------------------------------------------
;
; This file is part of Straylight's Sapphire library.
;
; Sapphire is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
;
; Sapphire is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with Sapphire.  If not, write to the Free Software Foundation,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

;----- Overview -------------------------------------------------------------
;
; Functions provided:
;
;  saveAs

		[	:LNOT::DEF:saveAs__dfn
		GBLL	saveAs__dfn

; --- saveAs ---
;
; On entry:	R0 == estimated size of data
;		R1 == file type of the data
;		R2 == pointer to name of the file
;		R3 == pointer to handler block
;		R4 == value to pass to handlers in R10
;		R5 == value to pass to handlers in R12
;
; On exit:	May return an error
;
; Use:		Displays a save as dialogue box for you to save some data.

		IMPORT	saveAs

;----- The SaveAs handler block ---------------------------------------------
;
; The block begins with the message tag for the dialogue title, followed by
; an align to word boundary and then branch instructions or 0 for:

		^	0
saEntry__closed	#	4			;Save dialogue has closed
						;Entry:
						;  --
						;Exit:
						;  --

saEntry__save	#	4			;Write to a file
						;Entry:
						;  R0 == pointer to file name
						;  R1 == 0 if file unsafe,
						;        non-0 if safe
						;Exit:
						;  --

saEntry__send	#	4			;Send a block of data
						;Entry:
						;  --
						;Exit:
						;  R0 == pointer to block
						;  R1 == size of block
						;  CS if this is the last one

saEntry__success	#	4		;Data transfer has finished
						;Entry:
						;  R0 == safeness flag
						;Exit:
						;  --

saEntry__failed	#	4			;Data transfer failed
						;Entry:
						;  R0 == 0 or ptr to error
						;  R1 == 1
						;Exit:
						;  --

		]

;----- That's all, folks ----------------------------------------------------

		END
