Ticket #1790: mc crashes on start
[midnight-commander.git] / src / vfsdummy.h
blob27af5edc15f7664b066e7ae1e6ea81c8881d19ec
2 /** \file vfsdummy.h
3 * \brief Header: replacement for vfs.h if VFS support is disabled
4 */
6 #ifndef MC_VFSDUMMY_H
7 #define MC_VFSDYMMY_H
9 #include "global.h" /* glib.h*/
10 #include "util.h"
12 /* Flags of VFS classes */
13 #define VFSF_LOCAL 1 /* Class is local (not virtual) filesystem */
14 #define VFSF_NOLINKS 2 /* Hard links not supported */
16 #define O_LINEAR 0
18 #define mc_close close
19 #define mc_read read
20 #define mc_write write
21 #define mc_lseek lseek
22 #define mc_opendir opendir
23 #define mc_readdir readdir
24 #define mc_closedir closedir
26 #define mc_stat stat
27 #define mc_mknod mknod
28 #define mc_link link
29 #define mc_mkdir mkdir
30 #define mc_rmdir rmdir
31 #define mc_fstat fstat
32 #define mc_lstat lstat
34 #define mc_readlink readlink
35 #define mc_symlink symlink
36 #define mc_rename rename
38 #define mc_open open
39 #define mc_utime utime
40 #define mc_chmod chmod
41 #define mc_chown chown
42 #define mc_chdir chdir
43 #define mc_unlink unlink
45 static inline int
46 return_zero (void)
48 return 0;
51 #define mc_ctl(a,b,c) return_zero()
52 #define mc_setctl(a,b,c) return_zero()
54 #define mc_get_current_wd(x,size) get_current_wd (x, size)
55 #define mc_getlocalcopy(x) vfs_canon(x)
56 #define mc_ungetlocalcopy(x,y,z) do { } while (0)
58 #define vfs_init() do { } while (0)
59 #define vfs_shut() do { } while (0)
61 #define vfs_current_is_local() 1
62 #define vfs_file_is_local(x) 1
63 #define vfs_strip_suffix_from_filename(x) g_strdup(x)
65 #define vfs_file_class_flags(x) (VFSF_LOCAL)
66 #define vfs_get_class(x) (struct vfs_class *)(NULL)
68 #define vfs_translate_url(s) g_strdup(s)
69 #define vfs_release_path(x)
70 #define vfs_add_current_stamps() do { } while (0)
71 #define vfs_timeout_handler() do { } while (0)
72 #define vfs_timeouts() 0
74 static inline char *
75 vfs_canon (const char *path)
77 char *p = g_strdup (path);
78 canonicalize_pathname(p);
79 return p;
82 #endif /* MC_VFSDUMMY_H */