home *** CD-ROM | disk | FTP | other *** search
- /*
- fsutils: (C) Steven Haslam 1992-1994
- Filing system utilities
- */
-
- #ifndef __fsutils_h
- #define __fsutils_h
-
- #include <time.h> /* Warning! Acorn C release 3 doesn't allow this twice */
-
- typedef int fshandle; /* A FileSwitch file handle */
-
- #define fs_badhandle -1
-
- /* fs_o_ are reason codes for fsopen() */
-
- #define fs_o_readonly 0x40
- #define fs_o_output 0x80
- #define fs_o_readwrite 0xC0
-
- #define fs_o_trapnotfound 0x08
- #define fs_o_trapdirobject 0x04
-
- #define fs_o_systempath 0x00
- #define fs_o_userpathvar 0x01
- #define fs_o_userpath 0x02
- #define fs_o_nopath 0x03
-
- /* e.g. to open a new file for output using a user path, trapping the notfound and directory-object errors, use:
-
- fshandle fsh;
-
- fsh = fsopen (fs_o_output | fs_o_trapnotfound | fs_o_trapdirobject | fs_o_userpath, filename, userpath);
- */
-
- /* fs_r_ and fs_w_ are reason codes for fsgbpb
- If *_userptr is used, add an extra parameter for the pointer to
- read from/write to */
-
- #define fs_r_userptr 3
- #define fs_r_systemptr 4
-
- #define fs_w_userptr 1
- #define fs_w_systemptr 2
-
- /* Reason codes for the fsseek's whence parameter */
-
- #define fs_s_set 0
- #define fs_s_cur 1
- #define fs_s_end 2
-
- typedef struct fsfind
- {
- char directory[256];
- char filename[16];
- char wildcard[16];
- int object;
- } fsfind_blk;
-
- typedef struct fsfstat
- {
- const char *filename;
- int length;
- time_t timestamp;
- int filetype;
- } fsfstat_blk;
-
- extern int fsfindf (const char*, const char*, struct fsfind*);
- extern int fsfindn (struct fsfind*);
- extern int fsfstat (struct fsfstat*);
- extern int fsloadf (void*, const char*);
- extern int fsfexists (const char*);
- extern int fssetsize (const char*, const int);
- extern int fssetinfo (struct fsfstat*);
- extern int fssettype (const char*, const int);
- extern int fsfensure (const char*);
- extern int fsmakedir (const char*);
- extern int fsclose (fshandle);
- extern fshandle fsopen (int, const char*, ...);
- extern int fsseek (fshandle, int, int);
- extern int fsgbpb (int, fshandle, const void*, int, ...);
- extern int fsext (fshandle);
- extern int fsptr (fshandle);
- extern int fsbget (fshandle);
- extern int fsbput (char, fshandle);
- extern int fscdir (const char*);
- extern int fsputs (const char*, fshandle);
-
- #endif
-