mirror of https://github.com/MidnightCommander/mc
* fish.c: Convert to calling vfs_register_class().
* fish.h: Eliminate. Adjust all dependencies. * direntry.c (vfs_s_init_class): Add missing vfs_s_setctl().
This commit is contained in:
parent
b2edfddd7e
commit
413f8cbabd
|
@ -1,5 +1,9 @@
|
|||
2003-10-10 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* fish.c: Convert to calling vfs_register_class().
|
||||
* fish.h: Eliminate. Adjust all dependencies.
|
||||
* direntry.c (vfs_s_init_class): Add missing vfs_s_setctl().
|
||||
|
||||
* vfs.h: Rename "struct _vfs" to "struct vfs_class". Allow
|
||||
calling vfs_register() in the file defining the VFS class.
|
||||
* vfs.c (vfs_init): Register cpiofs in cpio.c.
|
||||
|
|
|
@ -24,7 +24,6 @@ BASICFILES = \
|
|||
|
||||
VFSHDRS = \
|
||||
extfs.h \
|
||||
fish.h \
|
||||
ftpfs.h \
|
||||
local.h \
|
||||
mcfs.h \
|
||||
|
|
|
@ -1132,6 +1132,7 @@ vfs_s_init_class (struct vfs_class *vclass)
|
|||
vclass->nothingisopen = vfs_s_nothingisopen;
|
||||
vclass->free = vfs_s_free;
|
||||
vclass->getlocalcopy = vfs_s_getlocalcopy;
|
||||
vclass->setctl = vfs_s_setctl;
|
||||
}
|
||||
|
||||
/* ----------- Utility functions for networked filesystems -------------- */
|
||||
|
|
92
vfs/fish.c
92
vfs/fish.c
|
@ -44,7 +44,18 @@
|
|||
#include "xdirentry.h"
|
||||
#include "vfs.h"
|
||||
#include "tcputil.h"
|
||||
#include "fish.h"
|
||||
|
||||
#define FISH_DIRECTORY_TIMEOUT 30 * 60
|
||||
|
||||
#define DO_RESOLVE_SYMLINK 1
|
||||
#define DO_OPEN 2
|
||||
#define DO_FREE_RESOURCE 4
|
||||
|
||||
#define FISH_FLAG_COMPRESSED 1
|
||||
#define FISH_FLAG_RSH 2
|
||||
|
||||
#define OPT_FLUSH 1
|
||||
#define OPT_IGNORE_ERROR 2
|
||||
|
||||
/*
|
||||
* Reply codes.
|
||||
|
@ -66,6 +77,8 @@ static int force_expiration = 0;
|
|||
#define WANT_STRING 0x02
|
||||
static char reply_str [80];
|
||||
|
||||
static struct vfs_class vfs_fish_ops;
|
||||
|
||||
static int
|
||||
command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 4, 5)));
|
||||
|
@ -881,59 +894,24 @@ fish_fill_names (vfs *me, void (*func)(char *))
|
|||
}
|
||||
}
|
||||
|
||||
vfs vfs_fish_ops = {
|
||||
NULL, /* This is place of next pointer */
|
||||
"fish",
|
||||
F_EXEC, /* flags */
|
||||
"sh:", /* prefix */
|
||||
&fish_data, /* data */
|
||||
0, /* errno */
|
||||
NULL,
|
||||
NULL,
|
||||
fish_fill_names,
|
||||
NULL,
|
||||
|
||||
vfs_s_open,
|
||||
vfs_s_close,
|
||||
vfs_s_read,
|
||||
vfs_s_write,
|
||||
|
||||
vfs_s_opendir,
|
||||
vfs_s_readdir,
|
||||
vfs_s_closedir,
|
||||
vfs_s_telldir,
|
||||
vfs_s_seekdir,
|
||||
|
||||
vfs_s_stat,
|
||||
vfs_s_lstat,
|
||||
vfs_s_fstat,
|
||||
|
||||
fish_chmod,
|
||||
fish_chown,
|
||||
NULL, /* utime */
|
||||
|
||||
vfs_s_readlink,
|
||||
fish_symlink, /* symlink */
|
||||
fish_link, /* link */
|
||||
fish_unlink,
|
||||
|
||||
fish_rename, /* rename */
|
||||
vfs_s_chdir,
|
||||
vfs_s_ferrno,
|
||||
vfs_s_lseek,
|
||||
NULL, /* mknod */
|
||||
|
||||
vfs_s_getid,
|
||||
vfs_s_nothingisopen,
|
||||
vfs_s_free,
|
||||
|
||||
NULL, /* vfs_s_getlocalcopy, */
|
||||
NULL, /* vfs_s_ungetlocalcopy, */
|
||||
|
||||
fish_mkdir,
|
||||
fish_rmdir,
|
||||
fish_ctl,
|
||||
vfs_s_setctl
|
||||
|
||||
MMAPNULL
|
||||
};
|
||||
void
|
||||
init_fish (void)
|
||||
{
|
||||
vfs_s_init_class (&vfs_fish_ops);
|
||||
vfs_fish_ops.name = "fish";
|
||||
vfs_fish_ops.flags = F_EXEC;
|
||||
vfs_fish_ops.prefix = "sh:";
|
||||
vfs_fish_ops.data = &fish_data;
|
||||
vfs_fish_ops.fill_names = fish_fill_names;
|
||||
vfs_fish_ops.chmod = fish_chmod;
|
||||
vfs_fish_ops.chown = fish_chown;
|
||||
vfs_fish_ops.symlink = fish_symlink;
|
||||
vfs_fish_ops.link = fish_link;
|
||||
vfs_fish_ops.unlink = fish_unlink;
|
||||
vfs_fish_ops.rename = fish_rename;
|
||||
vfs_fish_ops.getlocalcopy = NULL;
|
||||
vfs_fish_ops.mkdir = fish_mkdir;
|
||||
vfs_fish_ops.rmdir = fish_rmdir;
|
||||
vfs_fish_ops.ctl = fish_ctl;
|
||||
vfs_register_class (&vfs_fish_ops);
|
||||
}
|
||||
|
|
19
vfs/fish.h
19
vfs/fish.h
|
@ -1,19 +0,0 @@
|
|||
/* fish.h */
|
||||
|
||||
#if !defined(__FISH_H)
|
||||
#define __FISH_H
|
||||
|
||||
/* Increased since now we may use C-r to reread the contents */
|
||||
#define FISH_DIRECTORY_TIMEOUT 30 * 60
|
||||
|
||||
#define DO_RESOLVE_SYMLINK 1
|
||||
#define DO_OPEN 2
|
||||
#define DO_FREE_RESOURCE 4
|
||||
|
||||
#define FISH_FLAG_COMPRESSED 1
|
||||
#define FISH_FLAG_RSH 2
|
||||
|
||||
#define OPT_FLUSH 1
|
||||
#define OPT_IGNORE_ERROR 2
|
||||
|
||||
#endif
|
|
@ -1240,7 +1240,7 @@ vfs_init (void)
|
|||
#ifdef USE_NETCODE
|
||||
tcp_init();
|
||||
vfs_register_class (&vfs_ftpfs_ops);
|
||||
vfs_register_class (&vfs_fish_ops);
|
||||
init_fish ();
|
||||
#ifdef WITH_SMBFS
|
||||
vfs_register_class (&vfs_smbfs_ops);
|
||||
#endif /* WITH_SMBFS */
|
||||
|
|
|
@ -107,19 +107,17 @@
|
|||
|
||||
/* Register a file system class */
|
||||
int vfs_register_class (struct vfs_class *vfs);
|
||||
void init_cpiofs (void);
|
||||
void init_fish (void);
|
||||
|
||||
extern vfs vfs_local_ops;
|
||||
extern vfs vfs_nil_ops;
|
||||
extern vfs vfs_tarfs_ops;
|
||||
void init_cpiofs (void);
|
||||
|
||||
extern vfs vfs_ftpfs_ops;
|
||||
extern vfs vfs_smbfs_ops;
|
||||
extern vfs vfs_fish_ops;
|
||||
extern vfs vfs_mcfs_ops;
|
||||
|
||||
extern vfs vfs_extfs_ops;
|
||||
extern vfs vfs_sfs_ops;
|
||||
|
||||
extern vfs vfs_undelfs_ops;
|
||||
|
||||
struct vfs_stamping {
|
||||
|
|
Loading…
Reference in New Issue