* vfsdummy.h: New file to replace vfs.h if VFS is disabled.

* Makefile.am: Add vfsdummy.h.
* global.h [!USE_VFS]: Include vfsdummy.h.  Fix files that
include vfs.h directly.
This commit is contained in:
Pavel Roskin 2003-10-11 08:54:31 +00:00
parent c09d542b9e
commit f219b81311
16 changed files with 90 additions and 14 deletions

View File

@ -1,5 +1,10 @@
2003-10-11 Pavel Roskin <proski@gnu.org>
* vfsdummy.h: New file to replace vfs.h if VFS is disabled.
* Makefile.am: Add vfsdummy.h.
* global.h [!USE_VFS]: Include vfsdummy.h. Fix files that
include vfs.h directly.
* file.c (check_hardlinks): Use vfs_file_class_flags().
* main.c (_do_panel_cd): Use vfs_release_path().

View File

@ -58,8 +58,8 @@ SRCS = achown.c achown.h background.c background.h boxes.c boxes.h \
profile.c profile.h regex.c rxvt.c screen.c setup.c setup.h \
slint.c subshell.c subshell.h terms.c textconf.c textconf.h \
tree.c tree.h treestore.c treestore.h tty.h user.c user.h \
util.c util.h utilunix.c view.c view.h widget.c widget.h \
win.c win.h wtools.c wtools.h
util.c util.h utilunix.c view.c view.h vfsdummy.h widget.c \
widget.h win.c win.h wtools.c wtools.h
if CHARSET
mc_SOURCES = $(SRCS) $(CHARSET_SRC)

View File

@ -52,7 +52,6 @@
#include "selcodepage.h"
#endif
#include "../vfs/vfs.h" /* vfs_timeout */
#ifdef USE_NETCODE
# include "../vfs/ftpfs.h"
#endif

View File

@ -42,7 +42,6 @@
#include "main.h"
#include "chown.h"
#include "wtools.h" /* For init_box_colors */
#include "../vfs/vfs.h"
#define UX 5
#define UY 2

View File

@ -40,7 +40,6 @@
#include "complete.h"
#include "main.h"
#include "key.h" /* XCTRL and ALT macros */
#include "../vfs/vfs.h"
/* This flag is used in filename_completion_function */
static int ignore_filenames = 0;

View File

@ -91,7 +91,6 @@
#include "filegui.h"
#include "tree.h"
#include "key.h"
#include "../vfs/vfs.h"
/* }}} */

View File

@ -26,7 +26,6 @@
#include <string.h>
#include <errno.h>
#include "global.h"
#include "../vfs/vfs.h"
static char *
get_absolute_name (char *file)

View File

@ -25,7 +25,6 @@
#include "global.h"
#include "fileopctx.h"
#include "../vfs/vfs.h"
/**

View File

@ -43,7 +43,6 @@
#include "wtools.h"
#include "cmd.h" /* view_file_at_line */
#include "boxes.h"
#include "../vfs/vfs.h"
/* Size of the find parameters window */
#define FIND_Y 14

View File

@ -132,7 +132,12 @@ struct timeval {
#include "util.h"
#include "textconf.h"
#ifdef USE_VFS
#include "../vfs/vfs.h"
#else
#include "vfsdummy.h"
#endif
extern char *home_dir;

View File

@ -38,7 +38,6 @@
#include "main.h"
#include "win.h"
#include "cons.saver.h"
#include "../vfs/vfs.h"
#ifdef HAVE_TEXTMODE_X11_SUPPORT
#ifdef HAVE_GMODULE

View File

@ -42,7 +42,6 @@
#include "global.h"
#include "treestore.h"
#include "../vfs/vfs.h"
#include "profile.h"
#include "setup.h"

View File

@ -36,7 +36,6 @@
#include "edit/edit.h" /* BLOCK_FILE */
#include "edit/edit-widget.h" /* WEdit */
#include "../vfs/vfs.h"
/* For the simple listbox manager */
#include "dlg.h"

View File

@ -37,7 +37,6 @@
#include "profile.h"
#include "main.h" /* mc_home */
#include "cmd.h" /* guess_message_value */
#include "../vfs/vfs.h"
#include "mountlist.h"
#include "win.h" /* xterm_flag */

78
src/vfsdummy.h Normal file
View File

@ -0,0 +1,78 @@
/* Replacement for vfs.h if VFS support is disabled */
#ifndef __VFSDUMMY_H
#define __VFSDYMMY_H
#undef USE_NETCODE
/* Flags of VFS classes */
#define VFSF_LOCAL 1 /* Class is local (not virtual) filesystem */
#define VFSF_NOLINKS 2 /* Hard links not supported */
#define O_LINEAR 0
#define mc_close close
#define mc_read read
#define mc_write write
#define mc_lseek lseek
#define mc_opendir opendir
#define mc_readdir readdir
#define mc_closedir closedir
#define mc_telldir telldir
#define mc_seekdir seekdir
#define mc_stat stat
#define mc_mknod mknod
#define mc_link link
#define mc_mkdir mkdir
#define mc_rmdir rmdir
#define mc_fstat fstat
#define mc_lstat lstat
#define mc_readlink readlink
#define mc_symlink symlink
#define mc_rename rename
#define mc_open open
#define mc_utime utime
#define mc_chmod chmod
#define mc_chown chown
#define mc_chdir chdir
#define mc_unlink unlink
#define mc_mmap mmap
#define mc_munmap munmap
static inline int
return_zero (void)
{
return 0;
}
#define mc_ctl(a,b,c) return_zero()
#define mc_setctl(a,b,c) return_zero()
#define mc_get_current_wd(x,size) get_current_wd (x, size)
#define mc_getlocalcopy(x) NULL
#define mc_ungetlocalcopy(x,y,z) do { } while (0)
#define vfs_init() do { } while (0)
#define vfs_shut() do { } while (0)
#define vfs_current_is_local() 1
#define vfs_file_is_local(x) 1
#define vfs_canon(p) g_strdup (canonicalize_pathname(p))
#define vfs_strip_suffix_from_filename(x) g_strdup(x)
#define vfs_file_class_flags(x) (VFSF_LOCAL)
#define vfs_get_class(x) (struct vfs_class *)(NULL)
#define vfs_translate_url(s) g_strdup(s)
#define vfs_release_path(x)
#define vfs_add_current_stamps() do { } while (0)
#define vfs_timeout_handler() do { } while (0)
#define vfs_timeouts() 0
#define ftpfs_flushdir() do { } while (0)
#endif /* !__VFSDUMMY_H */

View File

@ -49,7 +49,6 @@
#include "layout.h"
#include "setup.h"
#include "wtools.h" /* For query_set_sel() */
#include "../vfs/vfs.h"
#include "dir.h"
#include "panel.h" /* Needed for current_panel and other_panel */
#include "win.h"