chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / xfer / saveAs
1 ;
2 ; saveAs.sh
3 ;
4 ; Implementation of a save as dialogue box
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire.  If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ;  saveAs
32
33                 [       :LNOT::DEF:saveAs__dfn
34                 GBLL    saveAs__dfn
35
36 ; --- saveAs ---
37 ;
38 ; On entry:     R0 == estimated size of data
39 ;               R1 == file type of the data
40 ;               R2 == pointer to name of the file
41 ;               R3 == pointer to handler block
42 ;               R4 == value to pass to handlers in R10
43 ;               R5 == value to pass to handlers in R12
44 ;
45 ; On exit:      May return an error
46 ;
47 ; Use:          Displays a save as dialogue box for you to save some data.
48
49                 IMPORT  saveAs
50
51 ;----- The SaveAs handler block ---------------------------------------------
52 ;
53 ; The block begins with the message tag for the dialogue title, followed by
54 ; an align to word boundary and then branch instructions or 0 for:
55
56                 ^       0
57 saEntry__closed #       4                       ;Save dialogue has closed
58                                                 ;Entry:
59                                                 ;  --
60                                                 ;Exit:
61                                                 ;  --
62
63 saEntry__save   #       4                       ;Write to a file
64                                                 ;Entry:
65                                                 ;  R0 == pointer to file name
66                                                 ;  R1 == 0 if file unsafe,
67                                                 ;        non-0 if safe
68                                                 ;Exit:
69                                                 ;  --
70
71 saEntry__send   #       4                       ;Send a block of data
72                                                 ;Entry:
73                                                 ;  --
74                                                 ;Exit:
75                                                 ;  R0 == pointer to block
76                                                 ;  R1 == size of block
77                                                 ;  CS if this is the last one
78
79 saEntry__success        #       4               ;Data transfer has finished
80                                                 ;Entry:
81                                                 ;  R0 == safeness flag
82                                                 ;Exit:
83                                                 ;  --
84
85 saEntry__failed #       4                       ;Data transfer failed
86                                                 ;Entry:
87                                                 ;  R0 == 0 or ptr to error
88                                                 ;  R1 == 1
89                                                 ;Exit:
90                                                 ;  --
91
92                 ]
93
94 ;----- That's all, folks ----------------------------------------------------
95
96                 END