Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / xfer / save
1 ;
2 ; save.sh
3 ;
4 ; Saving data to other applications
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 ; save
32
33 [ :LNOT::DEF:save__dfn
34 GBLL save__dfn
35
36 ; --- save ---
37 ;
38 ; On entry: R0 == window handle to send to
39 ; R1 == icon handle to send to
40 ; R2 == estimated size of the data
41 ; R3 == file type of data to send and flag:
42 ; bit 31: use R8 as below
43 ; R4 == pointer to name of file (may be full path)
44 ; R5 == address of handler block
45 ; R6 == value to pass handlers in R10
46 ; R7 == value to pass handlers in R12
47 ; R8 == pointer to extra handler block (only if bit 31 of R3)
48 ;
49 ; On exit: --
50 ;
51 ; Use: Starts a save operation to another application. The extra
52 ; handler is used by systems like saveas which need to be
53 ; aware of data transfer start/end conditions without
54 ; interfering with the normal entry table. This will not
55 ; normally concern applications however.
56
57 IMPORT save
58
59 ;----- The save handler -----------------------------------------------------
60
61 ^ 0
62 sEntry__save # 4 ;Write to a file
63 ;Entry:
64 ; R0 == pointer to file name
65 ; R1 == 0 if file unsafe,
66 ; non-0 if safe
67 ;Exit:
68 ; --
69
70 sEntry__send # 4 ;Send a block of data
71 ;Entry:
72 ; R2 == 0 for first call,
73 ; or R2 from previous
74 ;Exit:
75 ; R0 == pointer to block
76 ; R1 == size of block
77 ; R2 == value to pass to
78 ; next call
79 ; CS if this is the last one
80
81 sEntry__success # 4 ;Data transfer has finished
82 ;Entry:
83 ; R0 == pointer to filename
84 ; R1 == safeness flag
85 ;Exit:
86 ; --
87
88 sEntry__failed # 4 ;Data transfer failed
89 ;Entry:
90 ; R0 == 0 or ptr to error
91 ; R1 == 1
92 ;Exit:
93 ; --
94
95 ]
96
97 ;----- That's all, folks ----------------------------------------------------
98
99 END