r286: Added some truncation code (not finished yet).
[rox-filer/ma.git] / ROX-Filer / src / my_vfs.h
blobd8d0a06c252e58af5f307560384a0a0e49247919
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@ecs.soton.ac.uk>.
6 */
8 #ifndef _MY_VFS_H
9 #define _MY_VFS_H
11 #ifdef HAVE_LIBVFS
13 /* We have the VFS library. Include the header file if possible, or define
14 * stuff ourselves if not.
17 # define VFS_STANDALONE 1
18 # ifdef HAVE_VFS_H
19 # include "vfs.h"
20 # else
21 # include <sys/stat.h>
22 # include <unistd.h>
23 # include <sys/types.h>
24 # include <dirent.h>
25 void mc_vfs_init(void);
26 DIR *mc_opendir (char *dirname);
27 struct dirent *mc_readdir(DIR *dirp);
28 int mc_closedir (DIR *dir);
29 int mc_telldir (DIR *dir);
30 void mc_seekdir (DIR *dir, int offset);
32 int mc_open (const char *filename, int flags, ...);
33 int mc_close (int handle);
34 int mc_read (int handle, char *buffer, int count);
35 int mc_write (int hanlde, char *buffer, int count);
37 int mc_stat (char *path, struct stat *buf);
38 int mc_lstat (char *path, struct stat *buf);
39 int mc_fstat (int fd, struct stat *buf);
40 # endif
42 #else /* HAVE_LIBVFS */
44 /* We don't have VFS installed. Just use the normal functions instead. */
46 # define mc_open open
47 # define mc_close close
48 # define mc_read read
49 # define mc_write write
51 # define mc_stat(x, y) stat(x, y)
52 # define mc_lstat(x, y) lstat(x, y)
53 # define mc_fstat(x, y) fstat(x, y)
54 # define mc_opendir(x) opendir(x)
55 # define mc_closedir(x) closedir(x)
56 # define mc_readdir(x) readdir(x)
57 # define mc_seekdir(x, o) seekdir(x, o)
58 # define mc_telldir(x) telldir(x)
60 #endif
62 #endif /* _MY_VFS_H */