revert between 56095 -> 55830 in arch
[AROS.git] / workbench / tools / Edit / DiskIO.h
blobcfe1d7146831cf2da14174b4ebaf8060cc20d958
1 /**************************************************************
2 **** diskio.h : prototypes for reading / writing files ****
3 **** Free software under GNU license, started on 25.2.2000 ****
4 **** © T.Pierron, C.Guillaume. ****
5 **************************************************************/
7 #ifndef DISKIO_H
8 #define DISKIO_H
10 #include "Memory.h"
12 /* This is the fields modified by load_file in Project datatype **
13 ** But because of this function may failed, we must use another **
14 ** datatype and re-fill original structure in case of success */
15 typedef struct
17 STRPTR filename; /* Just fill this field */
18 STRPTR buffer;
19 LINE *lines;
20 ULONG nblines;
21 char eol;
22 LONG protection;
23 } LoadFileArgs;
25 WORD load_file ( LoadFileArgs * );
26 WORD read_file ( LoadFileArgs *, ULONG * );
27 BYTE save_file ( STRPTR, LINE *, unsigned char eol, LONG protection );
28 BYTE get_full_path ( STRPTR, STRPTR * );
30 #ifndef INTUITION_INTUITION_H
31 struct Window;
32 #endif
34 /** Arguments to use with ask_save and ask_load function **/
35 typedef struct
37 STRPTR dir; /* Directory name */
38 STRPTR file; /* File name */
39 } AskArgs;
41 /** Split a name into two pointers **/
42 void split_path( AskArgs *, STRPTR *, STRPTR * );
44 /** Prompt user for a filename **/
45 STRPTR ask_save(struct Window *, AskArgs *, CONST_STRPTR);
47 /** Like previous but with ASL_LOAD. if setfile is 1 File gadget will
48 *** be initially fill. Otherwise it will be empty and multi-select will
49 *** be enabled. Thus a (StartUpArgs *) will be returned instead (utility.h).
50 **/
51 STRPTR ask_load(struct Window *, AskArgs *, BYTE setfile, CONST_STRPTR asltitle);
53 void free_diskio_alloc(void);
55 #endif