r3768: Updated years.
[rox-filer.git] / ROX-Filer / src / my_vfs.h
blob1ae372ec7fb5ba564aa11d56065de8c7d77a6466
1 /*
2 * ROX-Filer, filer for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
4 */
6 #ifndef _MY_VFS_H
7 #define _MY_VFS_H
9 #ifdef HAVE_LIBVFS
11 /* We have the VFS library. Include the header file if possible, or define
12 * stuff ourselves if not.
15 # define VFS_STANDALONE 1
16 # ifdef HAVE_VFS_H
17 # include "vfs.h"
18 # else
19 # include <sys/stat.h>
20 # include <unistd.h>
21 # include <sys/types.h>
22 # include <dirent.h>
23 void mc_vfs_init(void);
24 DIR *mc_opendir (char *dirname);
25 struct dirent *mc_readdir(DIR *dirp);
26 int mc_closedir (DIR *dir);
27 int mc_telldir (DIR *dir);
28 void mc_seekdir (DIR *dir, int offset);
30 int mc_open (const char *filename, int flags, ...);
31 int mc_close (int handle);
32 int mc_read (int handle, char *buffer, int count);
33 int mc_write (int hanlde, char *buffer, int count);
35 int mc_stat (char *path, struct stat *buf);
36 int mc_lstat (char *path, struct stat *buf);
37 int mc_fstat (int fd, struct stat *buf);
38 # endif
40 #else /* HAVE_LIBVFS */
42 /* We don't have VFS installed. Just use the normal functions instead. */
44 /* Include these here so that we don't get code that compiles with
45 * VFS but not without.
47 # include <sys/stat.h>
48 # include <unistd.h>
49 # include <sys/types.h>
50 # include <dirent.h>
52 # define mc_open open
53 # define mc_close close
54 # define mc_read read
55 # define mc_write write
57 # define mc_stat(x, y) stat(x, y)
58 # define mc_lstat(x, y) lstat(x, y)
59 # define mc_fstat(x, y) fstat(x, y)
60 # define mc_opendir(x) opendir(x)
61 # define mc_closedir(x) closedir(x)
62 # define mc_readdir(x) readdir(x)
63 # define mc_seekdir(x, o) seekdir(x, o)
64 # define mc_telldir(x) telldir(x)
66 #endif
68 #endif /* _MY_VFS_H */