VFS structure changes:

* moved from lib/vfs/mc-vfs to lib/vfs;
  * split by directories for VFS-plugins and moved to src/vfs;
  * lib/vfs/vfs-impl.h was merged into lib/vfs/vfs.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-02-15 15:44:17 +02:00
parent d512649b33
commit 6c5f5bf768
192 changed files with 1259 additions and 713 deletions

View File

@ -29,7 +29,7 @@ fi
cd "$srcdir" cd "$srcdir"
# The autoconf cache (version after 2.52) is not reliable yet. # The autoconf cache (version after 2.52) is not reliable yet.
rm -rf autom4te.cache lib/vfs/mc-vfs/samba/autom4te.cache rm -rf autom4te.cache src/vfs/smbfs/helpers/autom4te.cache
if test ! -d config; then if test ! -d config; then
mkdir config mkdir config
@ -72,16 +72,16 @@ $AUTOMAKE -a
test -f Makefile.in || \ test -f Makefile.in || \
{ echo "automake failed to generate Makefile.in" >&2; exit 1; } { echo "automake failed to generate Makefile.in" >&2; exit 1; }
cd lib/vfs/mc-vfs/samba cd src/vfs/smbfs/helpers
date -u >include/stamp-h.in date -u >include/stamp-h.in
$AUTOHEADER $AUTOHEADER
test -f include/config.h.in || \ test -f include/config.h.in || \
{ echo "autoheader failed to generate lib/vfs/mc-vfs/samba/include/config.h.in" >&2; exit 1; } { echo "autoheader failed to generate src/vfs/smbfs/helpers/include/config.h.in" >&2; exit 1; }
$AUTOCONF $AUTOCONF
test -f configure || \ test -f configure || \
{ echo "autoconf failed to generate lib/vfs/mc-vfs/samba/configure" >&2; exit 1; } { echo "autoconf failed to generate src/vfs/smbfs/helpers/configure" >&2; exit 1; }
) || exit 1 ) || exit 1
$srcdir/maint/version.sh "$srcdir" $srcdir/maint/version.sh "$srcdir"

View File

@ -542,6 +542,53 @@ src/viewer/Makefile
src/diffviewer/Makefile src/diffviewer/Makefile
src/filemanager/Makefile src/filemanager/Makefile
src/vfs/Makefile
src/vfs/cpio/Makefile
src/vfs/extfs/Makefile
src/vfs/extfs/helpers/Makefile
src/vfs/extfs/helpers/a+
src/vfs/extfs/helpers/apt+
src/vfs/extfs/helpers/audio
src/vfs/extfs/helpers/deb
src/vfs/extfs/helpers/deba
src/vfs/extfs/helpers/debd
src/vfs/extfs/helpers/dpkg+
src/vfs/extfs/helpers/iso9660
src/vfs/extfs/helpers/hp48+
src/vfs/extfs/helpers/lslR
src/vfs/extfs/helpers/mailfs
src/vfs/extfs/helpers/patchfs
src/vfs/extfs/helpers/rpms+
src/vfs/extfs/helpers/s3+
src/vfs/extfs/helpers/uace
src/vfs/extfs/helpers/ualz
src/vfs/extfs/helpers/uar
src/vfs/extfs/helpers/uarc
src/vfs/extfs/helpers/uarj
src/vfs/extfs/helpers/uc1541
src/vfs/extfs/helpers/uha
src/vfs/extfs/helpers/ulha
src/vfs/extfs/helpers/urar
src/vfs/extfs/helpers/uzip
src/vfs/extfs/helpers/uzoo
src/vfs/fish/Makefile
src/vfs/fish/helpers/Makefile
src/vfs/ftpfs/Makefile
src/vfs/local/Makefile
src/vfs/sfs/Makefile
src/vfs/smbfs/Makefile
src/vfs/tar/Makefile
src/vfs/undelfs/Makefile
lib/Makefile lib/Makefile
lib/event/Makefile lib/event/Makefile
lib/filehighlight/Makefile lib/filehighlight/Makefile
@ -550,35 +597,9 @@ lib/search/Makefile
lib/skin/Makefile lib/skin/Makefile
lib/strutil/Makefile lib/strutil/Makefile
lib/tty/Makefile lib/tty/Makefile
lib/vfs/Makefile lib/vfs/Makefile
lib/vfs/mc-vfs/Makefile
lib/vfs/mc-vfs/extfs/Makefile
lib/vfs/mc-vfs/extfs/a+
lib/vfs/mc-vfs/extfs/apt+
lib/vfs/mc-vfs/extfs/audio
lib/vfs/mc-vfs/extfs/deb
lib/vfs/mc-vfs/extfs/deba
lib/vfs/mc-vfs/extfs/debd
lib/vfs/mc-vfs/extfs/dpkg+
lib/vfs/mc-vfs/extfs/iso9660
lib/vfs/mc-vfs/extfs/hp48+
lib/vfs/mc-vfs/extfs/lslR
lib/vfs/mc-vfs/extfs/mailfs
lib/vfs/mc-vfs/extfs/patchfs
lib/vfs/mc-vfs/extfs/rpms+
lib/vfs/mc-vfs/extfs/s3+
lib/vfs/mc-vfs/extfs/uace
lib/vfs/mc-vfs/extfs/ualz
lib/vfs/mc-vfs/extfs/uar
lib/vfs/mc-vfs/extfs/uarc
lib/vfs/mc-vfs/extfs/uarj
lib/vfs/mc-vfs/extfs/uc1541
lib/vfs/mc-vfs/extfs/uha
lib/vfs/mc-vfs/extfs/ulha
lib/vfs/mc-vfs/extfs/urar
lib/vfs/mc-vfs/extfs/uzip
lib/vfs/mc-vfs/extfs/uzoo
lib/vfs/mc-vfs/fish/Makefile
lib/widget/Makefile lib/widget/Makefile
misc/syntax/Makefile misc/syntax/Makefile

View File

@ -48,5 +48,5 @@ libmc_la_LIBADD = \
strutil/libmcstrutil.la \ strutil/libmcstrutil.la \
skin/libmcskin.la \ skin/libmcskin.la \
tty/libmctty.la \ tty/libmctty.la \
vfs/mc-vfs/libvfs-mc.la \ vfs/libmcvfs.la \
widget/libmcwidget.la widget/libmcwidget.la

View File

@ -53,7 +53,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "lib/global.h" #include "lib/global.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/util.h" /* tilde_expand() */ #include "lib/util.h" /* tilde_expand() */
#include "lib/lock.h" #include "lib/lock.h"
#include "lib/widget.h" /* query_dialog() */ #include "lib/widget.h" /* query_dialog() */

View File

@ -26,7 +26,7 @@
#include <errno.h> /* extern int errno */ #include <errno.h> /* extern int errno */
#include "lib/global.h" #include "lib/global.h"
#include "lib/vfs/mc-vfs/vfs.h" /* mc_stat */ #include "lib/vfs/vfs.h" /* mc_stat */
#include "lib/util.h" #include "lib/util.h"
#include "lib/mcconfig.h" #include "lib/mcconfig.h"

View File

@ -32,7 +32,7 @@
#include "lib/global.h" #include "lib/global.h"
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/

View File

@ -40,7 +40,7 @@
#include "lib/global.h" #include "lib/global.h"
#include "lib/strutil.h" /* str_casecmp */ #include "lib/strutil.h" /* str_casecmp */
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "tty.h" #include "tty.h"
#include "tty-internal.h" /* mouse_enabled */ #include "tty-internal.h" /* mouse_enabled */

View File

@ -44,7 +44,7 @@
#include "lib/tty/win.h" /* xterm_flag */ #include "lib/tty/win.h" /* xterm_flag */
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -52,7 +52,7 @@
#include <grp.h> #include <grp.h>
#include "lib/global.h" #include "lib/global.h"
#include "lib/vfs/mc-vfs/vfs.h" /* VFS_ENCODING_PREFIX */ #include "lib/vfs/vfs.h" /* VFS_ENCODING_PREFIX */
#include "lib/strutil.h" /* str_move() */ #include "lib/strutil.h" /* str_move() */
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" /* message() */ #include "lib/widget.h" /* message() */

View File

@ -1 +1,15 @@
SUBDIRS = mc-vfs noinst_LTLIBRARIES = libmcvfs.la
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
libmcvfs_la_SOURCES = \
vfs.c vfs.h \
direntry.c xdirentry.h \
utilvfs.c utilvfs.h \
gc.c gc.h
if ENABLE_VFS_NET
libmcvfs_la_SOURCES += netutil.c netutil.h
endif
EXTRA_DIST = HACKING README

View File

@ -47,7 +47,7 @@
#include "src/filemanager/layout.h" /* print_vfs_message */ #include "src/filemanager/layout.h" /* print_vfs_message */
#include "vfs-impl.h" #include "vfs.h"
#include "utilvfs.h" #include "utilvfs.h"
#include "xdirentry.h" #include "xdirentry.h"
#include "gc.h" /* vfs_rmstamp */ #include "gc.h" /* vfs_rmstamp */

View File

@ -47,7 +47,7 @@
#include "src/filemanager/midnight.h" /* current_panel */ #include "src/filemanager/midnight.h" /* current_panel */
#include "src/filemanager/layout.h" /* get_current_type(), get_other_type() */ #include "src/filemanager/layout.h" /* get_current_type(), get_other_type() */
#include "vfs-impl.h" #include "vfs.h"
#include "utilvfs.h" #include "utilvfs.h"
#include "gc.h" #include "gc.h"

View File

@ -6,7 +6,7 @@
#ifndef MC__VFS_GC_H #ifndef MC__VFS_GC_H
#define MC__VFS_GC_H #define MC__VFS_GC_H
#include "vfs-impl.h" #include "vfs.h"
/*** typedefs(not structures) and defined constants **********************************************/ /*** typedefs(not structures) and defined constants **********************************************/

View File

@ -1,11 +0,0 @@
Makefile
Makefile.in
mcserv
mcservx
rar
cpio
zoo
zip
lha
.deps
*.sor

View File

@ -1,152 +0,0 @@
if ENABLE_VFS_SMB
SAMBA_CFLAGS = -DCONFIGDIR=\""@smbconfigdir@"\"
SAMBA_SUBDIRS = samba
endif
DIST_SUBDIRS = extfs fish
SUBDIRS = $(SAMBA_SUBDIRS)
if ENABLE_VFS_EXTFS
SUBDIRS += extfs
endif
if ENABLE_VFS_FISH
SUBDIRS += fish
endif
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(SAMBA_CFLAGS)
AM_CPPFLAGS = -DLIBEXECDIR=\""$(libexecdir)/@PACKAGE@/"\"
BASICFILES = \
vfs.c vfs.h vfs-impl.h \
direntry.c xdirentry.h \
utilvfs.c utilvfs.h \
gc.c gc.h \
local.c local.h
CPIOFILES = cpio.c
TARFILES = tar.c
SFSFILES = sfs.c
EXTFSFILES = extfs.c
UNDELFILES = undelfs.c
NETFILES = netutil.c netutil.h
FTPFILES = ftpfs.c ftpfs.h
FISHFILES = fish.c fish.h fishdef.h
SMBFILES = smbfs.c smbfs.h
libvfs_mc_la_SOURCES = $(BASICFILES)
if ENABLE_VFS_CPIO
libvfs_mc_la_SOURCES += $(CPIOFILES)
endif
if ENABLE_VFS_TAR
libvfs_mc_la_SOURCES += $(TARFILES)
endif
if ENABLE_VFS_SFS
libvfs_mc_la_SOURCES += $(SFSFILES)
endif
if ENABLE_VFS_EXTFS
libvfs_mc_la_SOURCES += $(EXTFSFILES)
endif
if ENABLE_VFS_UNDELFS
libvfs_mc_la_SOURCES += $(UNDELFILES)
endif
if ENABLE_VFS_NET
libvfs_mc_la_SOURCES += $(NETFILES)
endif
if ENABLE_VFS_FTP
libvfs_mc_la_SOURCES += $(FTPFILES)
endif
if ENABLE_VFS_FISH
libvfs_mc_la_SOURCES += $(FISHFILES)
endif
if ENABLE_VFS_SMB
libvfs_mc_la_SOURCES += $(SMBFILES)
endif
EXTRA_DIST = HACKING README \
$(BASICFILES) \
$(CPIOFILES) \
$(TARFILES) \
$(SFSFILES) \
$(EXTFSFILES) \
$(UNDELFILES) \
$(NETFILES) \
$(FTPFILES) \
$(FISHFILES) \
$(SMBFILES)
dist-hook:
$(mkinstalldirs) $(distdir)/samba
$(mkinstalldirs) $(distdir)/samba/include
$(mkinstalldirs) $(distdir)/samba/lib
$(mkinstalldirs) $(distdir)/samba/libsmb
$(mkinstalldirs) $(distdir)/samba/param
for I in $(SAMBA_DIST); do \
cp -p $(srcdir)/samba/$$I $(distdir)/samba/$$I || exit 1; \
done
mostlyclean-local:
if test -f samba/Makefile; then \
(cd samba && $(MAKE) mostlyclean) \
else :; fi
clean-local:
if test -f samba/Makefile; then \
(cd samba && $(MAKE) clean) \
else :; fi
distclean-local:
if test -f samba/Makefile; then \
(cd samba && $(MAKE) distclean) \
else :; fi
noinst_LTLIBRARIES = libvfs-mc.la
SAMBA_DIST = \
Makefile.in \
aclocal.m4 \
configure.ac \
configure \
internals.doc \
parsing.doc \
include/byteorder.h \
include/charset.h \
include/client.h \
include/config.h.in \
include/includes.h \
include/kanji.h \
include/local.h \
include/nameserv.h \
include/nterr.h \
include/proto.h \
include/smb.h \
include/stamp-h.in \
include/trans2.h \
include/version.h \
lib/charcnv.c \
lib/charset.c \
lib/debug.c \
lib/interface.c \
lib/kanji.c \
lib/md4.c \
lib/netmask.c \
lib/slprintf.c \
lib/system.c \
lib/time.c \
lib/username.c \
lib/util.c \
lib/util_file.c \
lib/util_sock.c \
lib/util_str.c \
libsmb/clientgen.c \
libsmb/namequery.c \
libsmb/nmblib.c \
libsmb/nterr.c \
libsmb/pwd_cache.c \
libsmb/smbdes.c \
libsmb/smbencrypt.c \
libsmb/smberr.c \
param/loadparm.c \
param/params.c

View File

@ -1,178 +0,0 @@
FIles transferred over SHell protocol (V 0.0.2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This protocol was designed for transferring files over a remote shell
connection (rsh and compatibles). It can be as well used for transfers over
rsh, and there may be other uses.
Client sends requests of following form:
#FISH_COMMAND
equivalent shell commands,
which may be multiline
Only fish commands are defined here, shell equivalents are for your
information only and will probably vary from implementation to
implementation. Fish commands always have priority: server is
expected to execute fish command if it understands it. If it does not,
however, it can try the luck and execute shell command.
Server's reply is multiline, but always ends with
### 000<optional text>
line. ### is prefix to mark this line, 000 is return code. Return
codes are superset to those used in ftp.
There are few new exit codes defined:
000 don't know; if there were no previous lines, this marks COMPLETE
success, if they were, it marks failure.
001 don't know; if there were no previous lines, this marks
PRELIMinary success, if they were, it marks failure
Connecting
~~~~~~~~~~
Client uses "echo FISH:;/bin/sh" as command executed on remote
machine. This should make it possible for server to distinguish FISH
connections from normal rsh/ssh.
Commands
~~~~~~~~
#FISH
echo; start_fish_server; echo '### 200'
This command is sent at the beginning. It marks that client wishes to
talk via FISH protocol. #VER command must follow. If server
understands FISH protocol, it has option to put FISH server somewhere
on system path and name it start_fish_server.
#VER 0.0.2 <feature1> <feature2> <...>
echo '### 000'
This command is the second one. It sends client version and extensions
to the server. Server should reply with protocol version to be used,
and list of extensions accepted.
VER 0.0.0 <feature2>
### 200
#PWD
pwd; echo '### 200'
Server should reply with current directory (in form /abc/def/ghi)
followed by line indicating success.
#LIST /directory
ls -lLa $1 | grep '^[^cbt]' | ( while read p x u g s m d y n; do echo "P$p $u.$g
S$s
d$m $d $y
:$n
"; done )
ls -lLa $1 | grep '^[cb]' | ( while read p x u g a i m d y n; do echo "P$p $u.$g
E$a$i
dD$m $d $y
:$n
"; done )
echo '### 200'
This allows client to list directory or get status information about
single file. Output is in following form (any line except :<filename>
may be omitted):
P<unix permissions> <owner>.<group>
S<size>
d<3-letters month name> <day> <year or HH:MM>
D<year> <month> <day> <hour> <minute> <second>[.1234]
E<major-of-device>,<minor>
:<filename>
L<filename symlink points to>
<blank line to separate items>
Unix permissions are of form X--------- where X is type of
file. Currently, '-' means regular file, 'd' means directory, 'c', 'b'
means character and block device, 'l' means symbolic link, 'p' means
FIFO and 's' means socket.
'd' has three fields: month (one of strings Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec), day of month, and third is either single
number indicating year, or HH:MM field (assume current year in such
case). As you've probably noticed, this is pretty broken; it is for
compatibility with ls listing.
#RETR /some/name
ls -l /some/name | ( read a b c d x e; echo $x ); echo '### 100'; cat /some/name; echo '### 200'
Server sends line with filesize on it, followed by line with ### 100
indicating partial success, then it sends binary data (exactly
filesize bytes) and follows them with (with no preceding newline) ###
200.
Note that there's no way to abort running RETR command - except
closing the connection.
#STOR <size> /file/name
> /file/name; echo '### 001'; ( dd bs=4096 count=<size/4096>; dd bs=<size%4096> count=1 ) 2>/dev/null | ( cat > %s; cat > /dev/null ); echo '### 200'
This command is for storing /file/name, which is exactly size bytes
big. You probably think I went crazy. Well, I did not: that strange
cat > /dev/null has purpose to discard any extra data which was not
written to disk (due to for example out of space condition).
[Why? Imagine uploading file with "rm -rf /" line in it.]
#CWD /somewhere
cd /somewhere; echo '### 000'
It is specified here, but I'm not sure how wise idea is to use this
one: it breaks stateless-ness of the protocol.
Following commands should be rather self-explanatory:
#CHMOD 1234 file
chmod 1234 file; echo '### 000'
#DELE /some/path
rm -f /some/path; echo '### 000'
#MKD /some/path
mkdir /some/path; echo '### 000'
#RMD /some/path
rmdir /some/path; echo '### 000'
#RENAME /path/a /path/b
mv /path/a /path/b; echo '### 000'
#LINK /path/a /path/b
ln /path/a /path/b; echo '### 000'
#SYMLINK /path/a /path/b
ln -s /path/a /path/b; echo '### 000'
#CHOWN user /file/name
chown user /file/name; echo '### 000'
#CHGRP group /file/name
chgrp group /file/name; echo '### 000'
#READ <offset> <size> /path/and/filename
cat /path/and/filename | ( dd bs=4096 count=<offset/4096> > /dev/null;
dd bs=<offset%4096> count=1 > /dev/null;
dd bs=4096 count=<offset/4096>;
dd bs=<offset%4096> count=1; )
Returns ### 200 on successful exit, ### 291 on successful exit when
reading ended at eof, ### 292 on successfull exit when reading did not
end at eof.
#WRITE <offset> <size> /path/and/filename
Hmm, shall we define these ones if we know our client is not going to
use them?
That's all, folks!
pavel@ucw.cz

View File

@ -1,147 +0,0 @@
/**
* \file
* \brief Header: VFS implemntation (?)
*/
#ifndef MC__VFS_IMPL_H
#define MC__VFS_IMPL_H
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <dirent.h>
#include <stddef.h>
#include <utime.h>
#include "vfs.h"
#include "lib/fs.h" /* MC_MAXPATHLEN */
/*** typedefs(not structures) and defined constants **********************************************/
typedef void *vfsid;
/*** enums ***************************************************************************************/
/*** structures declarations (and typedefs of structures)*****************************************/
struct vfs_stamping;
struct vfs_class
{
struct vfs_class *next;
const char *name; /* "FIles over SHell" */
vfs_class_flags_t flags;
const char *prefix; /* "fish:" */
void *data; /* this is for filesystem's own use */
int verrno; /* can't use errno because glibc2 might define errno as function */
int (*init) (struct vfs_class * me);
void (*done) (struct vfs_class * me);
/**
* The fill_names method shall call the callback function for every
* filesystem name that this vfs module supports.
*/
void (*fill_names) (struct vfs_class * me, fill_names_f);
/**
* The which() method shall return the index of the vfs subsystem
* or -1 if this vfs cannot handle the given pathname.
*/
int (*which) (struct vfs_class * me, const char *path);
void *(*open) (struct vfs_class * me, const char *fname, int flags, mode_t mode);
int (*close) (void *vfs_info);
ssize_t (*read) (void *vfs_info, char *buffer, size_t count);
ssize_t (*write) (void *vfs_info, const char *buf, size_t count);
void *(*opendir) (struct vfs_class * me, const char *dirname);
void *(*readdir) (void *vfs_info);
int (*closedir) (void *vfs_info);
int (*stat) (struct vfs_class * me, const char *path, struct stat * buf);
int (*lstat) (struct vfs_class * me, const char *path, struct stat * buf);
int (*fstat) (void *vfs_info, struct stat * buf);
int (*chmod) (struct vfs_class * me, const char *path, int mode);
int (*chown) (struct vfs_class * me, const char *path, uid_t owner, gid_t group);
int (*utime) (struct vfs_class * me, const char *path, struct utimbuf * times);
int (*readlink) (struct vfs_class * me, const char *path, char *buf, size_t size);
int (*symlink) (struct vfs_class * me, const char *n1, const char *n2);
int (*link) (struct vfs_class * me, const char *p1, const char *p2);
int (*unlink) (struct vfs_class * me, const char *path);
int (*rename) (struct vfs_class * me, const char *p1, const char *p2);
int (*chdir) (struct vfs_class * me, const char *path);
int (*ferrno) (struct vfs_class * me);
off_t (*lseek) (void *vfs_info, off_t offset, int whence);
int (*mknod) (struct vfs_class * me, const char *path, mode_t mode, dev_t dev);
vfsid (*getid) (struct vfs_class * me, const char *path);
int (*nothingisopen) (vfsid id);
void (*free) (vfsid id);
char *(*getlocalcopy) (struct vfs_class * me, const char *filename);
int (*ungetlocalcopy) (struct vfs_class * me, const char *filename,
const char *local, int has_changed);
int (*mkdir) (struct vfs_class * me, const char *path, mode_t mode);
int (*rmdir) (struct vfs_class * me, const char *path);
int (*ctl) (void *vfs_info, int ctlop, void *arg);
int (*setctl) (struct vfs_class * me, const char *path, int ctlop, void *arg);
};
/*
* This union is used to ensure that there is enough space for the
* filename (d_name) when the dirent structure is created.
*/
union vfs_dirent
{
struct dirent dent;
char _extra_buffer[offsetof (struct dirent, d_name) + MC_MAXPATHLEN + 1];
};
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
/* Register a file system class */
int vfs_register_class (struct vfs_class *vfs);
struct vfs_class *vfs_split (char *path, char **inpath, char **op);
char *vfs_path (const char *path);
/* vfs/direntry.c: */
void *vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode);
vfsid vfs_getid (struct vfs_class *vclass, const char *dir);
#ifdef ENABLE_VFS_CPIO
void init_cpiofs (void);
#endif
#ifdef ENABLE_VFS_TAR
void init_tarfs (void);
#endif
#ifdef ENABLE_VFS_SFS
void init_sfs (void);
#endif
#ifdef ENABLE_VFS_EXTFS
void init_extfs (void);
#endif
#ifdef ENABLE_VFS_UNDELFS
void init_undelfs (void);
#endif
#ifdef ENABLE_VFS_FTP
void init_ftpfs (void);
#endif
#ifdef ENABLE_VFS_FISH
void init_fish (void);
#endif
/*** inline functions ****************************************************************************/
#endif /* MC_VFS_IMPL_H */

View File

@ -42,7 +42,7 @@
#include "src/history.h" #include "src/history.h"
#include "vfs-impl.h" #include "vfs.h"
#include "utilvfs.h" #include "utilvfs.h"
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/

View File

@ -60,22 +60,10 @@
#endif #endif
#include "src/setup.h" /* cd_symlinks */ #include "src/setup.h" /* cd_symlinks */
#include "vfs-impl.h" #include "vfs.h"
#include "utilvfs.h" #include "utilvfs.h"
#include "gc.h" #include "gc.h"
#ifdef ENABLE_VFS_NET
#include "netutil.h"
#endif
#ifdef ENABLE_VFS_FTP
#include "ftpfs.h"
#endif
#ifdef ENABLE_VFS_SMB
#include "smbfs.h"
#endif
#include "local.h"
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/
/*** file scope macro definitions ****************************************************************/ /*** file scope macro definitions ****************************************************************/
@ -112,10 +100,9 @@ static char *current_dir;
static GPtrArray *vfs_openfiles; static GPtrArray *vfs_openfiles;
static long vfs_free_handle_list = -1; static long vfs_free_handle_list = -1;
static struct vfs_class *localfs_class;
static GString *vfs_str_buffer; static GString *vfs_str_buffer;
static struct vfs_class *vfs_list; static GPtrArray *vfs_list = NULL;
static struct dirent *mc_readdir_result = NULL; static struct dirent *mc_readdir_result = NULL;
@ -240,20 +227,23 @@ vfs_free_handle (int handle)
static struct vfs_class * static struct vfs_class *
vfs_prefix_to_class (char *prefix) vfs_prefix_to_class (char *prefix)
{ {
struct vfs_class *vfs; guint i;
/* Avoid last class (localfs) that would accept any prefix */ /* Avoid first class (localfs) that would accept any prefix */
for (vfs = vfs_list; vfs->next != NULL; vfs = vfs->next) for (i = 1; i < vfs_list->len; i++)
{ {
struct vfs_class *vfs = (struct vfs_class *) g_ptr_array_index (vfs_list, i);
if (vfs->which != NULL) if (vfs->which != NULL)
{ {
if ((*vfs->which) (vfs, prefix) == -1) if (vfs->which (vfs, prefix) == -1)
continue; continue;
return vfs; return vfs;
} }
if (vfs->prefix != NULL && strncmp (prefix, vfs->prefix, strlen (vfs->prefix)) == 0) if (vfs->prefix != NULL && strncmp (prefix, vfs->prefix, strlen (vfs->prefix)) == 0)
return vfs; return vfs;
} }
return NULL; return NULL;
} }
@ -444,20 +434,6 @@ _vfs_get_cwd (void)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
static void
vfs_setup_wd (void)
{
current_dir = g_strdup (PATH_SEP_STR);
_vfs_get_cwd ();
if (strlen (current_dir) > MC_MAXPATHLEN - 2)
vfs_die ("Current dir too long.\n");
current_vfs = vfs_get_class (current_dir);
}
/* --------------------------------------------------------------------------------------------- */
static char * static char *
mc_def_getlocalcopy (const char *filename) mc_def_getlocalcopy (const char *filename)
{ {
@ -562,17 +538,16 @@ mc_def_ungetlocalcopy (struct vfs_class *vfs, const char *filename,
/*** public functions ****************************************************************************/ /*** public functions ****************************************************************************/
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
int gboolean
vfs_register_class (struct vfs_class * vfs) vfs_register_class (struct vfs_class * vfs)
{ {
if (vfs->init != NULL) /* vfs has own initialization function */ if (vfs->init != NULL) /* vfs has own initialization function */
if (!(*vfs->init) (vfs)) /* but it failed */ if (!vfs->init (vfs)) /* but it failed */
return 0; return FALSE;
vfs->next = vfs_list; g_ptr_array_add (vfs_list, vfs);
vfs_list = vfs;
return 1; return TRUE;
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -584,7 +559,7 @@ vfs_register_class (struct vfs_class *vfs)
char * char *
vfs_strip_suffix_from_filename (const char *filename) vfs_strip_suffix_from_filename (const char *filename)
{ {
struct vfs_class *vfs; guint i;
char *semi; char *semi;
char *p; char *p;
@ -596,20 +571,23 @@ vfs_strip_suffix_from_filename (const char *filename)
if (semi == NULL) if (semi == NULL)
return p; return p;
/* Avoid last class (localfs) that would accept any prefix */ /* Avoid first class (localfs) that would accept any prefix */
for (vfs = vfs_list; vfs->next != NULL; vfs = vfs->next) for (i = 1; i < vfs_list->len; i++)
{ {
struct vfs_class *vfs = (struct vfs_class *) g_ptr_array_index (vfs_list, i);
if (vfs->which != NULL) if (vfs->which != NULL)
{ {
if ((*vfs->which) (vfs, semi + 1) == -1) if (vfs->which (vfs, semi + 1) == -1)
continue; continue;
*semi = '\0'; /* Found valid suffix */ *semi = '\0'; /* Found valid suffix */
return p; break;
} }
if (vfs->prefix != NULL && strncmp (semi + 1, vfs->prefix, strlen (vfs->prefix)) == 0) if (vfs->prefix != NULL && strncmp (semi + 1, vfs->prefix, strlen (vfs->prefix)) == 0)
{ {
*semi = '\0'; /* Found valid suffix */ *semi = '\0'; /* Found valid suffix */
return p; break;
} }
} }
return p; return p;
@ -678,14 +656,15 @@ vfs_split (char *path, char **inpath, char **op)
struct vfs_class * struct vfs_class *
vfs_get_class (const char *pathname) vfs_get_class (const char *pathname)
{ {
char *path;
struct vfs_class *vfs; struct vfs_class *vfs;
char *path = g_strdup (pathname);
path = g_strdup (pathname);
vfs = _vfs_get_class (path); vfs = _vfs_get_class (path);
g_free (path); g_free (path);
if (!vfs) if (vfs == NULL)
vfs = localfs_class; vfs = g_ptr_array_index (vfs_list, 0); /* localfs */
return vfs; return vfs;
} }
@ -1440,42 +1419,28 @@ mc_ungetlocalcopy (const char *pathname, const char *local, int has_changed)
void void
vfs_init (void) vfs_init (void)
{ {
/* create the VFS handle arrays */
vfs_list = g_ptr_array_new ();
/* create the VFS handle array */ /* create the VFS handle array */
vfs_openfiles = g_ptr_array_new (); vfs_openfiles = g_ptr_array_new ();
vfs_str_buffer = g_string_new (""); vfs_str_buffer = g_string_new ("");
/* localfs needs to be the first one */
init_localfs ();
/* fallback value for vfs_get_class() */
localfs_class = vfs_list;
#ifdef ENABLE_VFS_CPIO }
init_cpiofs ();
#endif /* ENABLE_VFS_CPIO */
#ifdef ENABLE_VFS_TAR
init_tarfs ();
#endif /* ENABLE_VFS_TAR */
#ifdef ENABLE_VFS_SFS
init_sfs ();
#endif /* ENABLE_VFS_SFS */
#ifdef ENABLE_VFS_EXTFS
init_extfs ();
#endif /* ENABLE_VFS_EXTFS */
#ifdef ENABLE_VFS_UNDELFS
init_undelfs ();
#endif /* ENABLE_VFS_UNDELFS */
#ifdef ENABLE_VFS_FTP /* --------------------------------------------------------------------------------------------- */
init_ftpfs ();
#endif /* ENABLE_VFS_FTP */
#ifdef ENABLE_VFS_FISH
init_fish ();
#endif /* ENABLE_VFS_FISH */
#ifdef ENABLE_VFS_SMB
init_smbfs ();
#endif /* ENABLE_VFS_SMB */
vfs_setup_wd (); void
vfs_setup_work_dir (void)
{
current_dir = g_strdup (PATH_SEP_STR);
_vfs_get_cwd ();
if (strlen (current_dir) > MC_MAXPATHLEN - 2)
vfs_die ("Current dir too long.\n");
current_vfs = vfs_get_class (current_dir);
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
@ -1483,17 +1448,22 @@ vfs_init (void)
void void
vfs_shut (void) vfs_shut (void)
{ {
struct vfs_class *vfs; guint i;
vfs_gc_done (); vfs_gc_done ();
g_free (current_dir); g_free (current_dir);
for (vfs = vfs_list; vfs; vfs = vfs->next) for (i = 0; i < vfs_list->len; i++)
if (vfs->done) {
(*vfs->done) (vfs); struct vfs_class *vfs = (struct vfs_class *) g_ptr_array_index (vfs_list, i);
if (vfs->done != NULL)
vfs->done (vfs);
}
g_ptr_array_free (vfs_openfiles, TRUE); g_ptr_array_free (vfs_openfiles, TRUE);
g_ptr_array_free (vfs_list, TRUE);
g_string_free (vfs_str_buffer, TRUE); g_string_free (vfs_str_buffer, TRUE);
g_free (mc_readdir_result); g_free (mc_readdir_result);
} }
@ -1507,11 +1477,15 @@ vfs_shut (void)
void void
vfs_fill_names (fill_names_f func) vfs_fill_names (fill_names_f func)
{ {
struct vfs_class *vfs; guint i;
for (vfs = vfs_list; vfs; vfs = vfs->next) for (i = 0; i < vfs_list->len; i++)
if (vfs->fill_names) {
(*vfs->fill_names) (vfs, func); struct vfs_class *vfs = (struct vfs_class *) g_ptr_array_index (vfs_list, i);
if (vfs->fill_names != NULL)
vfs->fill_names (vfs, func);
}
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */

View File

@ -8,11 +8,16 @@
#define MC__VFS_VFS_H #define MC__VFS_VFS_H
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
#include <utime.h> #include <utime.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stddef.h>
#include "lib/global.h" #include "lib/global.h"
#include "lib/fs.h" /* MC_MAXPATHLEN */
/*** typedefs(not structures) and defined constants **********************************************/ /*** typedefs(not structures) and defined constants **********************************************/
@ -87,6 +92,8 @@
typedef void (*fill_names_f) (const char *); typedef void (*fill_names_f) (const char *);
typedef void *vfsid;
/*** enums ***************************************************************************************/ /*** enums ***************************************************************************************/
/* Flags of VFS classes */ /* Flags of VFS classes */
@ -118,7 +125,81 @@ enum
/*** structures declarations (and typedefs of structures)*****************************************/ /*** structures declarations (and typedefs of structures)*****************************************/
struct vfs_class; typedef struct vfs_class
{
const char *name; /* "FIles over SHell" */
vfs_class_flags_t flags;
const char *prefix; /* "fish:" */
void *data; /* this is for filesystem's own use */
int verrno; /* can't use errno because glibc2 might define errno as function */
int (*init) (struct vfs_class * me);
void (*done) (struct vfs_class * me);
/**
* The fill_names method shall call the callback function for every
* filesystem name that this vfs module supports.
*/
void (*fill_names) (struct vfs_class * me, fill_names_f);
/**
* The which() method shall return the index of the vfs subsystem
* or -1 if this vfs cannot handle the given pathname.
*/
int (*which) (struct vfs_class * me, const char *path);
void *(*open) (struct vfs_class * me, const char *fname, int flags, mode_t mode);
int (*close) (void *vfs_info);
ssize_t (*read) (void *vfs_info, char *buffer, size_t count);
ssize_t (*write) (void *vfs_info, const char *buf, size_t count);
void *(*opendir) (struct vfs_class * me, const char *dirname);
void *(*readdir) (void *vfs_info);
int (*closedir) (void *vfs_info);
int (*stat) (struct vfs_class * me, const char *path, struct stat * buf);
int (*lstat) (struct vfs_class * me, const char *path, struct stat * buf);
int (*fstat) (void *vfs_info, struct stat * buf);
int (*chmod) (struct vfs_class * me, const char *path, int mode);
int (*chown) (struct vfs_class * me, const char *path, uid_t owner, gid_t group);
int (*utime) (struct vfs_class * me, const char *path, struct utimbuf * times);
int (*readlink) (struct vfs_class * me, const char *path, char *buf, size_t size);
int (*symlink) (struct vfs_class * me, const char *n1, const char *n2);
int (*link) (struct vfs_class * me, const char *p1, const char *p2);
int (*unlink) (struct vfs_class * me, const char *path);
int (*rename) (struct vfs_class * me, const char *p1, const char *p2);
int (*chdir) (struct vfs_class * me, const char *path);
int (*ferrno) (struct vfs_class * me);
off_t (*lseek) (void *vfs_info, off_t offset, int whence);
int (*mknod) (struct vfs_class * me, const char *path, mode_t mode, dev_t dev);
vfsid (*getid) (struct vfs_class * me, const char *path);
int (*nothingisopen) (vfsid id);
void (*free) (vfsid id);
char *(*getlocalcopy) (struct vfs_class * me, const char *filename);
int (*ungetlocalcopy) (struct vfs_class * me, const char *filename,
const char *local, int has_changed);
int (*mkdir) (struct vfs_class * me, const char *path, mode_t mode);
int (*rmdir) (struct vfs_class * me, const char *path);
int (*ctl) (void *vfs_info, int ctlop, void *arg);
int (*setctl) (struct vfs_class * me, const char *path, int ctlop, void *arg);
} vfs_class;
/*
* This union is used to ensure that there is enough space for the
* filename (d_name) when the dirent structure is created.
*/
union vfs_dirent
{
struct dirent dent;
char _extra_buffer[offsetof (struct dirent, d_name) + MC_MAXPATHLEN + 1];
};
/*** global variables defined in .c file *********************************************************/ /*** global variables defined in .c file *********************************************************/
@ -130,16 +211,26 @@ extern int use_netrc;
/*** declarations of public functions ************************************************************/ /*** declarations of public functions ************************************************************/
/* lib/vfs/direntry.c: */
void *vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode);
vfsid vfs_getid (struct vfs_class *vclass, const char *dir);
void vfs_init (void); void vfs_init (void);
void vfs_shut (void); void vfs_shut (void);
/* Register a file system class */
gboolean vfs_register_class (struct vfs_class *vfs);
void vfs_setup_work_dir (void);
void vfs_timeout_handler (void); void vfs_timeout_handler (void);
int vfs_timeouts (void); int vfs_timeouts (void);
void vfs_expire (int now); void vfs_expire (int now);
char *vfs_get_current_dir (void);
gboolean vfs_current_is_local (void); gboolean vfs_current_is_local (void);
gboolean vfs_file_is_local (const char *filename); gboolean vfs_file_is_local (const char *filename);
ssize_t mc_read (int handle, void *buffer, size_t count); ssize_t mc_read (int handle, void *buffer, size_t count);
ssize_t mc_write (int handle, const void *buffer, size_t count); ssize_t mc_write (int handle, const void *buffer, size_t count);
int mc_utime (const char *path, struct utimbuf *times); int mc_utime (const char *path, struct utimbuf *times);
@ -172,6 +263,9 @@ char *mc_getlocalcopy (const char *pathname);
char *vfs_strip_suffix_from_filename (const char *filename); char *vfs_strip_suffix_from_filename (const char *filename);
char *vfs_translate_url (const char *url); char *vfs_translate_url (const char *url);
struct vfs_class *vfs_split (char *path, char **inpath, char **op);
char *vfs_path (const char *path);
struct vfs_class *vfs_get_class (const char *path); struct vfs_class *vfs_get_class (const char *path);
vfs_class_flags_t vfs_file_class_flags (const char *filename); vfs_class_flags_t vfs_file_class_flags (const char *filename);
@ -179,11 +273,14 @@ vfs_class_flags_t vfs_file_class_flags (const char *filename);
* return static buffer */ * return static buffer */
const char *vfs_get_encoding (const char *path); const char *vfs_get_encoding (const char *path);
/* return new string */
char *vfs_translate_path_n (const char *path);
/* canonize and translate path, return new string */ /* canonize and translate path, return new string */
char *vfs_canon_and_translate (const char *path); char *vfs_canon_and_translate (const char *path);
/* translate path back to terminal encoding, remove all #enc:
* every invalid character is replaced with question mark
* return static buffer */
char *vfs_translate_path (const char *path);
/* return new string */
char *vfs_translate_path_n (const char *path);
void vfs_stamp_path (const char *path); void vfs_stamp_path (const char *path);
@ -191,11 +288,5 @@ void vfs_release_path (const char *dir);
void vfs_fill_names (fill_names_f); void vfs_fill_names (fill_names_f);
char *vfs_get_current_dir (void);
/* translate path back to terminal encoding, remove all #enc:
* every invalid character is replaced with question mark
* return static buffer */
char *vfs_translate_path (const char *path);
/*** inline functions ****************************************************************************/ /*** inline functions ****************************************************************************/
#endif /* MC_VFS_VFS_H */ #endif /* MC_VFS_VFS_H */

View File

@ -42,7 +42,7 @@
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/tty/mouse.h" #include "lib/tty/mouse.h"
#include "lib/tty/key.h" /* XCTRL and ALT macros */ #include "lib/tty/key.h" /* XCTRL and ALT macros */
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/strutil.h" #include "lib/strutil.h"

View File

@ -19,7 +19,7 @@ AC_DEFUN([AC_MC_VFS_SMB],
fi fi
if test "$enable_vfs_smb" = "yes"; then if test "$enable_vfs_smb" = "yes"; then
AC_CONFIG_SUBDIRS([lib/vfs/mc-vfs/samba]) AC_CONFIG_SUBDIRS([src/vfs/smbfs/helpers])
AM_CONDITIONAL([ENABLE_VFS_SMB], [test "1" = "1"]) AM_CONDITIONAL([ENABLE_VFS_SMB], [test "1" = "1"])

View File

@ -1,4 +1,4 @@
SUBDIRS = filemanager man2hlp viewer SUBDIRS = filemanager man2hlp vfs viewer
if USE_EDIT if USE_EDIT
SUBDIRS += editor SUBDIRS += editor
@ -34,6 +34,7 @@ DIFFLIB = diffviewer/libdiffviewer.la
endif endif
mc_LDADD = \ mc_LDADD = \
vfs/libmc-vfs.la \
viewer/libmcviewer.la \ viewer/libmcviewer.la \
filemanager/libmcfilemanager.la \ filemanager/libmcfilemanager.la \
$(DIFFLIB) $(EDITLIB) \ $(DIFFLIB) $(EDITLIB) \
@ -41,7 +42,7 @@ mc_LDADD = \
if ENABLE_VFS_SMB if ENABLE_VFS_SMB
# this is a hack for linking with own samba library in simple way # this is a hack for linking with own samba library in simple way
mc_LDADD += ../lib/vfs/mc-vfs/samba/libsamba.a mc_LDADD += vfs/smbfs/helpers/libsamba.a
endif endif
mc_LDADD += $(MCLIBS) $(SLANGLIB) mc_LDADD += $(MCLIBS) $(SLANGLIB)

View File

@ -33,12 +33,13 @@
#include "lib/tty/color.h" /* command_line_colors */ #include "lib/tty/color.h" /* command_line_colors */
#include "lib/tty/mouse.h" #include "lib/tty/mouse.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#ifdef ENABLE_VFS_SMB
#include "lib/vfs/mc-vfs/smbfs.h" /* smbfs_set_debugf() */
#endif
#include "lib/util.h" /* x_basename() */ #include "lib/util.h" /* x_basename() */
#ifdef ENABLE_VFS_SMB
#include "src/vfs/smbfs/smbfs.h" /* smbfs_set_debugf() */
#endif
#include "src/main.h" #include "src/main.h"
#include "src/textconf.h" #include "src/textconf.h"
#include "src/subshell.h" /* use_subshell */ #include "src/subshell.h" /* use_subshell */

View File

@ -38,7 +38,7 @@
#include "lib/tty/color.h" #include "lib/tty/color.h"
#include "lib/tty/key.h" #include "lib/tty/key.h"
#include "lib/skin.h" /* EDITOR_NORMAL_COLOR */ #include "lib/skin.h" /* EDITOR_NORMAL_COLOR */
#include "lib/vfs/mc-vfs/vfs.h" /* mc_opendir, mc_readdir, mc_closedir, */ #include "lib/vfs/vfs.h" /* mc_opendir, mc_readdir, mc_closedir, */
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" #include "lib/widget.h"
#include "lib/charsets.h" #include "lib/charsets.h"

View File

@ -46,7 +46,7 @@
#include "lib/tty/tty.h" /* attrset() */ #include "lib/tty/tty.h" /* attrset() */
#include "lib/tty/key.h" /* is_idle() */ #include "lib/tty/key.h" /* is_idle() */
#include "lib/skin.h" /* EDITOR_NORMAL_COLOR */ #include "lib/skin.h" /* EDITOR_NORMAL_COLOR */
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strutil.h" /* utf string functions */ #include "lib/strutil.h" /* utf string functions */
#include "lib/util.h" /* load_file_position(), save_file_position() */ #include "lib/util.h" /* load_file_position(), save_file_position() */
#include "lib/timefmt.h" /* time formatting */ #include "lib/timefmt.h" /* time formatting */

View File

@ -53,7 +53,7 @@
#include "lib/strutil.h" /* utf string functions */ #include "lib/strutil.h" /* utf string functions */
#include "lib/lock.h" #include "lib/lock.h"
#include "lib/util.h" /* tilde_expand() */ #include "lib/util.h" /* tilde_expand() */
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/widget.h" #include "lib/widget.h"
#include "lib/charsets.h" #include "lib/charsets.h"

View File

@ -30,7 +30,7 @@
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/tty/key.h" #include "lib/tty/key.h"
#include "lib/tty/win.h" #include "lib/tty/win.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" #include "lib/widget.h"

View File

@ -39,7 +39,7 @@
#include "lib/tty/key.h" /* XCTRL and ALT macros */ #include "lib/tty/key.h" /* XCTRL and ALT macros */
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" #include "lib/widget.h"

View File

@ -42,12 +42,12 @@
#include "lib/mcconfig.h" /* Load/save user formats */ #include "lib/mcconfig.h" /* Load/save user formats */
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#ifdef ENABLE_VFS_FTP #ifdef ENABLE_VFS_FTP
#include "lib/vfs/mc-vfs/ftpfs.h" #include "src/vfs/ftpfs/ftpfs.h"
#endif /* ENABLE_VFS_FTP */ #endif /* ENABLE_VFS_FTP */
#ifdef ENABLE_VFS_SMB #ifdef ENABLE_VFS_SMB
#include "lib/vfs/mc-vfs/smbfs.h" #include "src/vfs/smbfs/smbfs.h"
#endif /* ENABLE_VFS_SMB */ #endif /* ENABLE_VFS_SMB */
#include "lib/util.h" /* Q_() */ #include "lib/util.h" /* Q_() */

View File

@ -35,7 +35,7 @@
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" #include "lib/widget.h"

View File

@ -36,7 +36,7 @@
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" #include "lib/widget.h"

View File

@ -53,7 +53,7 @@
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/search.h" #include "lib/search.h"
#include "lib/filehighlight.h" /* MC_FHL_INI_FILE */ #include "lib/filehighlight.h" /* MC_FHL_INI_FILE */
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -34,7 +34,7 @@
#include "lib/global.h" /* home_dir */ #include "lib/global.h" /* home_dir */
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strescape.h" #include "lib/strescape.h"
#include "lib/skin.h" /* DEFAULT_COLOR */ #include "lib/skin.h" /* DEFAULT_COLOR */
#include "lib/util.h" #include "lib/util.h"

View File

@ -40,7 +40,7 @@
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/tty/key.h" /* XCTRL and ALT macros */ #include "lib/tty/key.h" /* XCTRL and ALT macros */
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strescape.h" #include "lib/strescape.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -30,7 +30,7 @@
#include "lib/global.h" #include "lib/global.h"
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/search.h" #include "lib/search.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/fs.h" #include "lib/fs.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -38,7 +38,7 @@
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/widget.h" #include "lib/widget.h"
#include "lib/charsets.h" /* get_codepage_index */ #include "lib/charsets.h" /* get_codepage_index */

View File

@ -62,7 +62,7 @@
#include "lib/strescape.h" #include "lib/strescape.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/widget.h" #include "lib/widget.h"
#include "src/setup.h" #include "src/setup.h"

View File

@ -81,7 +81,7 @@
#include "lib/tty/key.h" /* tty_get_event */ #include "lib/tty/key.h" /* tty_get_event */
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/search.h" #include "lib/search.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strescape.h" #include "lib/strescape.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/timefmt.h" /* file_date() */ #include "lib/timefmt.h" /* file_date() */

View File

@ -37,7 +37,7 @@
#include "lib/global.h" #include "lib/global.h"
#include "lib/fs.h" #include "lib/fs.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/

View File

@ -36,7 +36,7 @@
#include "fileopctx.h" #include "fileopctx.h"
#include "filegui.h" #include "filegui.h"
#include "lib/search.h" #include "lib/search.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/

View File

@ -39,9 +39,9 @@
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/search.h" #include "lib/search.h"
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/vfs/vfs.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/widget.h" #include "lib/widget.h"
#include "lib/vfs/mc-vfs/vfs.h"
#include "lib/util.h" /* canonicalize_pathname() */ #include "lib/util.h" /* canonicalize_pathname() */
#include "src/setup.h" /* verbose */ #include "src/setup.h" /* verbose */

View File

@ -48,7 +48,7 @@
#include "lib/mcconfig.h" /* Load/save directories hotlist */ #include "lib/mcconfig.h" /* Load/save directories hotlist */
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" #include "lib/widget.h"

View File

@ -51,7 +51,7 @@
#include "lib/tty/mouse.h" #include "lib/tty/mouse.h"
#include "lib/tty/win.h" /* do_enter_ca_mode() */ #include "lib/tty/win.h" /* do_enter_ca_mode() */
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/vfs/mc-vfs/vfs.h" /* For vfs_translate_url() */ #include "lib/vfs/vfs.h" /* For vfs_translate_url() */
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/widget.h" #include "lib/widget.h"

View File

@ -49,7 +49,7 @@
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/vfs/mc-vfs/vfs.h" /* vfs_translate_url() */ #include "lib/vfs/vfs.h" /* vfs_translate_url() */
#include "src/args.h" #include "src/args.h"
#include "src/subshell.h" #include "src/subshell.h"

View File

@ -40,7 +40,7 @@
#include "lib/strescape.h" #include "lib/strescape.h"
#include "lib/filehighlight.h" #include "lib/filehighlight.h"
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/unixcompat.h" #include "lib/unixcompat.h"
#include "lib/timefmt.h" #include "lib/timefmt.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -36,7 +36,7 @@
#include "lib/global.h" #include "lib/global.h"
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/mcconfig.h" /* Load/save directories panelize */ #include "lib/mcconfig.h" /* Load/save directories panelize */
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -45,7 +45,7 @@
#include "lib/tty/mouse.h" #include "lib/tty/mouse.h"
#include "lib/tty/key.h" #include "lib/tty/key.h"
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -49,7 +49,7 @@
#include "lib/global.h" #include "lib/global.h"
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/hook.h" #include "lib/hook.h"
#include "lib/util.h" #include "lib/util.h"

View File

@ -32,7 +32,7 @@
#include "lib/tty/tty.h" #include "lib/tty/tty.h"
#include "lib/skin.h" #include "lib/skin.h"
#include "lib/search.h" #include "lib/search.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" #include "lib/widget.h"

View File

@ -50,7 +50,7 @@
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/util.h" #include "lib/util.h"
#include "lib/vfs/mc-vfs/vfs.h" /* vfs_init(), vfs_shut() */ #include "lib/vfs/vfs.h" /* vfs_init(), vfs_shut() */
#include "filemanager/midnight.h" /* current_panel */ #include "filemanager/midnight.h" /* current_panel */
#include "filemanager/treestore.h" /* tree_store_save */ #include "filemanager/treestore.h" /* tree_store_save */
@ -58,6 +58,8 @@
#include "filemanager/ext.h" /* flush_extension_file() */ #include "filemanager/ext.h" /* flush_extension_file() */
#include "filemanager/command.h" /* cmdline */ #include "filemanager/command.h" /* cmdline */
#include "vfs/plugins_init.h"
#include "events_init.h" #include "events_init.h"
#include "args.h" #include "args.h"
#include "subshell.h" #include "subshell.h"
@ -445,6 +447,8 @@ main (int argc, char *argv[])
str_init_strings (NULL); str_init_strings (NULL);
vfs_init (); vfs_init ();
vfs_plugins_init();
vfs_setup_work_dir ();
if (!mc_args_handle (argc, argv, "mc")) if (!mc_args_handle (argc, argv, "mc"))
exit (EXIT_FAILURE); exit (EXIT_FAILURE);

View File

@ -36,13 +36,13 @@
#include "lib/fileloc.h" #include "lib/fileloc.h"
#include "lib/timefmt.h" #include "lib/timefmt.h"
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#ifdef ENABLE_VFS_FTP #ifdef ENABLE_VFS_FTP
#include "lib/vfs/mc-vfs/ftpfs.h" #include "src/vfs/ftpfs/ftpfs.h"
#endif #endif
#ifdef ENABLE_VFS_FISH #ifdef ENABLE_VFS_FISH
#include "lib/vfs/mc-vfs/fish.h" #include "src/vfs/fish/fish.h"
#endif #endif
#include "lib/util.h" #include "lib/util.h"

View File

@ -51,7 +51,7 @@
#include "lib/tty/tty.h" /* LINES */ #include "lib/tty/tty.h" /* LINES */
#include "lib/tty/key.h" /* XCTRL */ #include "lib/tty/key.h" /* XCTRL */
#include "lib/vfs/mc-vfs/vfs.h" #include "lib/vfs/vfs.h"
#include "lib/strutil.h" #include "lib/strutil.h"
#include "lib/mcconfig.h" #include "lib/mcconfig.h"
#include "lib/util.h" #include "lib/util.h"

489
src/vfs/COPYING.LGPL Normal file
View File

@ -0,0 +1,489 @@
Please note that the VFS code when *not* linked with SAMBA is released
under the GNU LGPL license.
If you link your VFS with the SAMBA sources, the resulting library is
covered by the terms of the GNU GPL.
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

47
src/vfs/Makefile.am Normal file
View File

@ -0,0 +1,47 @@
noinst_LTLIBRARIES = libmc-vfs.la
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
libmc_vfs_la_SOURCES = plugins_init.c plugins_init.h
SUBDIRS = local
libmc_vfs_la_LIBADD = local/libvfs-local.la
if ENABLE_VFS_CPIO
SUBDIRS += cpio
libmc_vfs_la_LIBADD += cpio/libvfs-cpio.la
endif
if ENABLE_VFS_EXTFS
SUBDIRS += extfs
libmc_vfs_la_LIBADD += extfs/libvfs-extfs.la
endif
if ENABLE_VFS_FISH
SUBDIRS += fish
libmc_vfs_la_LIBADD += fish/libvfs-fish.la
endif
if ENABLE_VFS_FTP
SUBDIRS += ftpfs
libmc_vfs_la_LIBADD += ftpfs/libvfs-ftpfs.la
endif
if ENABLE_VFS_SFS
SUBDIRS += sfs
libmc_vfs_la_LIBADD += sfs/libvfs-sfs.la
endif
if ENABLE_VFS_SMB
SUBDIRS += smbfs
libmc_vfs_la_LIBADD += smbfs/libvfs-smbfs.la
endif
if ENABLE_VFS_TAR
SUBDIRS += tar
libmc_vfs_la_LIBADD += tar/libvfs-tar.la
endif
if ENABLE_VFS_UNDELFS
SUBDIRS += undelfs
libmc_vfs_la_LIBADD += undelfs/libvfs-undelfs.la
endif

7
src/vfs/cpio/Makefile.am Normal file
View File

@ -0,0 +1,7 @@
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
AM_CPPFLAGS =
noinst_LTLIBRARIES = libvfs-cpio.la
libvfs_cpio_la_SOURCES = \
cpio.c cpio.h

View File

@ -34,10 +34,12 @@
#include "lib/util.h" #include "lib/util.h"
#include "lib/widget.h" /* message() */ #include "lib/widget.h" /* message() */
#include "vfs-impl.h" #include "lib/vfs/vfs.h"
#include "utilvfs.h" #include "lib/vfs/utilvfs.h"
#include "xdirentry.h" #include "lib/vfs/xdirentry.h"
#include "gc.h" /* vfs_rmstamp */ #include "lib/vfs/gc.h" /* vfs_rmstamp */
#include "cpio.h"
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/

18
src/vfs/cpio/cpio.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef MC__VFS_CPIO_H
#define MC__VFS_CPIO_H
/*** typedefs(not structures) and defined constants **********************************************/
/*** enums ***************************************************************************************/
/*** structures declarations (and typedefs of structures)*****************************************/
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
void init_cpiofs(void);
/*** inline functions ****************************************************************************/
#endif /* MC__VFS_CPIO_H */

10
src/vfs/extfs/Makefile.am Normal file
View File

@ -0,0 +1,10 @@
SUBDIRS = helpers
DIST_SUBDIRS = helpers
AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
AM_CPPFLAGS = -DLIBEXECDIR=\""$(libexecdir)/@PACKAGE@/"\"
noinst_LTLIBRARIES = libvfs-extfs.la
libvfs_extfs_la_SOURCES = \
extfs.c extfs.h

View File

@ -55,9 +55,11 @@
#include "src/main.h" /* shell */ #include "src/main.h" /* shell */
#include "src/execute.h" /* For shell_execute */ #include "src/execute.h" /* For shell_execute */
#include "vfs-impl.h" #include "lib/vfs/vfs.h"
#include "utilvfs.h" #include "lib/vfs/utilvfs.h"
#include "gc.h" /* vfs_rmstamp */ #include "lib/vfs/gc.h" /* vfs_rmstamp */
#include "extfs.h"
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/

18
src/vfs/extfs/extfs.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef MC__VFS_EXTFS_H
#define MC__VFS_EXTFS_H
/*** typedefs(not structures) and defined constants **********************************************/
/*** enums ***************************************************************************************/
/*** structures declarations (and typedefs of structures)*****************************************/
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
void init_extfs(void);
/*** inline functions ****************************************************************************/
#endif /* MC__VFS_CPIO_H */

Some files were not shown because too many files have changed in this diff Show More