Browse Source

* vfs.h: Remove typedef vfs, it's too ambiguous. Massive
changes to use struct vfs_class instead.

Pavel Roskin 21 years ago
parent
commit
00b57fd4bf
10 changed files with 226 additions and 223 deletions
  1. 3 0
      vfs/ChangeLog
  2. 19 19
      vfs/cpio.c
  3. 45 45
      vfs/direntry.c
  4. 25 25
      vfs/extfs.c
  5. 25 25
      vfs/fish.c
  6. 43 43
      vfs/ftpfs.c
  7. 24 24
      vfs/local.c
  8. 3 3
      vfs/local.h
  9. 21 21
      vfs/mcfs.c
  10. 18 18
      vfs/sfs.c

+ 3 - 0
vfs/ChangeLog

@@ -1,5 +1,8 @@
 2003-10-11  Pavel Roskin  <proski@gnu.org>
 
+	* vfs.h: Remove typedef vfs, it's too ambiguous.  Massive
+	changes to use struct vfs_class instead.
+
 	* vfs.c (vfs_setup_wd): Initialize current_vfs here, not
 	globally.
 	(vfs_type_from_op): Rename to vfs_prefix_to_class(), avoid using

+ 19 - 19
vfs/cpio.c

@@ -89,11 +89,11 @@ struct defer_inode {
 
 static int cpio_position;
 
-static int cpio_find_head(vfs *me, vfs_s_super *super);
-static int cpio_read_bin_head(vfs *me, vfs_s_super *super);
-static int cpio_read_oldc_head(vfs *me, vfs_s_super *super);
-static int cpio_read_crc_head(vfs *me, vfs_s_super *super);
-static int cpio_create_entry(vfs *me, vfs_s_super *super, struct stat *stat, char *name);
+static int cpio_find_head(struct vfs_class *me, vfs_s_super *super);
+static int cpio_read_bin_head(struct vfs_class *me, vfs_s_super *super);
+static int cpio_read_oldc_head(struct vfs_class *me, vfs_s_super *super);
+static int cpio_read_crc_head(struct vfs_class *me, vfs_s_super *super);
+static int cpio_create_entry(struct vfs_class *me, vfs_s_super *super, struct stat *stat, char *name);
 static int cpio_read(void *fh, char *buffer, int count);
 
 #define CPIO_POS(super) cpio_position
@@ -127,13 +127,13 @@ static int cpio_skip_padding(vfs_s_super *super)
     }
 }
 
-static void cpio_free_archive(vfs *me, vfs_s_super *super)
+static void cpio_free_archive(struct vfs_class *me, vfs_s_super *super)
 {
     if(super->u.cpio.fd != -1)
 	mc_close(super->u.cpio.fd);
 }
 
-static int cpio_open_cpio_file(vfs *me, vfs_s_super *super, char *name)
+static int cpio_open_cpio_file(struct vfs_class *me, vfs_s_super *super, char *name)
 {
     int fd, type;
     mode_t mode;
@@ -182,7 +182,7 @@ static int cpio_open_cpio_file(vfs *me, vfs_s_super *super, char *name)
     return fd;
 }
 
-static int cpio_read_head(vfs *me, vfs_s_super *super)
+static int cpio_read_head(struct vfs_class *me, vfs_s_super *super)
 {
     switch(cpio_find_head(me, super)) {
     case CPIO_UNKNOWN:
@@ -205,7 +205,7 @@ static int cpio_read_head(vfs *me, vfs_s_super *super)
 #define SEEKBACK CPIO_SEEK_CUR(super, ptr - top)
 #define RETURN(x) return(super->u.cpio.type = (x))
 #define TYPEIS(x) ((super->u.cpio.type == CPIO_UNKNOWN) || (super->u.cpio.type == (x)))
-static int cpio_find_head(vfs *me, vfs_s_super *super)
+static int cpio_find_head(struct vfs_class *me, vfs_s_super *super)
 {
     char buf[256];
     int ptr = 0;
@@ -246,7 +246,7 @@ static int cpio_find_head(vfs *me, vfs_s_super *super)
 #undef SEEKBACK
 
 #define HEAD_LENGTH (26)
-static int cpio_read_bin_head(vfs *me, vfs_s_super *super)
+static int cpio_read_bin_head(struct vfs_class *me, vfs_s_super *super)
 {
     struct old_cpio_header buf;
     int len;
@@ -291,7 +291,7 @@ static int cpio_read_bin_head(vfs *me, vfs_s_super *super)
 #undef HEAD_LENGTH
 
 #define HEAD_LENGTH (76)
-static int cpio_read_oldc_head(vfs *me, vfs_s_super *super)
+static int cpio_read_oldc_head(struct vfs_class *me, vfs_s_super *super)
 {
     struct new_cpio_header hd;
     struct stat stat;
@@ -340,7 +340,7 @@ static int cpio_read_oldc_head(vfs *me, vfs_s_super *super)
 #undef HEAD_LENGTH
 
 #define HEAD_LENGTH (110)
-static int cpio_read_crc_head(vfs *me, vfs_s_super *super)
+static int cpio_read_crc_head(struct vfs_class *me, vfs_s_super *super)
 {
     struct new_cpio_header hd;
     struct stat stat;
@@ -393,7 +393,7 @@ static int cpio_read_crc_head(vfs *me, vfs_s_super *super)
     return cpio_create_entry(me, super, &stat, name);
 }
 
-static int cpio_create_entry(vfs *me, vfs_s_super *super, struct stat *stat, char *name)
+static int cpio_create_entry(struct vfs_class *me, vfs_s_super *super, struct stat *stat, char *name)
 {
     vfs_s_inode *inode = NULL;
     vfs_s_inode *root = super->root;
@@ -509,7 +509,7 @@ static int cpio_create_entry(vfs *me, vfs_s_super *super, struct stat *stat, cha
 
 /* Need to CPIO_SEEK_CUR to skip the file at the end of add entry!!!! */
 
-static int cpio_open_archive(vfs *me, vfs_s_super *super, char *name, char *op)
+static int cpio_open_archive(struct vfs_class *me, vfs_s_super *super, char *name, char *op)
 {
     int status = STATUS_START;
 
@@ -535,7 +535,7 @@ static int cpio_open_archive(vfs *me, vfs_s_super *super, char *name, char *op)
 }
 
 /* Remaining functions are exactly same as for tarfs (and were in fact just copied) */
-static void *cpio_super_check(vfs *me, char *archive_name, char *op)
+static void *cpio_super_check(struct vfs_class *me, char *archive_name, char *op)
 {
     static struct stat sb;
     if(mc_stat(archive_name, &sb))
@@ -544,7 +544,7 @@ static void *cpio_super_check(vfs *me, char *archive_name, char *op)
 }
 
 static int
-cpio_super_same (vfs *me, struct vfs_s_super *parc, char *archive_name,
+cpio_super_same (struct vfs_class *me, struct vfs_s_super *parc, char *archive_name,
 		 char *op, void *cookie)
 {
     struct stat *archive_stat = cookie;	/* stat of main archive */
@@ -568,7 +568,7 @@ static int cpio_read(void *fh, char *buffer, int count)
 {
     off_t begin = FH->ino->u.tar.data_offset;
     int fd = FH_SUPER->u.tar.fd;
-    vfs *me = FH_SUPER->me;
+    struct vfs_class *me = FH_SUPER->me;
 
     if (mc_lseek (fd, begin + FH->pos, SEEK_SET) != 
         begin + FH->pos) ERRNOR (EIO, -1);
@@ -581,14 +581,14 @@ static int cpio_read(void *fh, char *buffer, int count)
     return count;
 }
 
-static int cpio_ungetlocalcopy(vfs *me, char *path, char *local, int has_changed)
+static int cpio_ungetlocalcopy(struct vfs_class *me, char *path, char *local, int has_changed)
 {
 /* We do just nothing. (We are read only and do not need to free local,
    since it will be freed when tar archive will be freed */
     return 0;
 }
 
-static int cpio_fh_open(vfs *me, vfs_s_fh *fh, int flags, int mode)
+static int cpio_fh_open(struct vfs_class *me, vfs_s_fh *fh, int flags, int mode)
 {
     if ((flags & O_ACCMODE) != O_RDONLY) ERRNOR (EROFS, -1);
     return 0;

+ 45 - 45
vfs/direntry.c

@@ -34,11 +34,11 @@
 
 static volatile int total_inodes = 0, total_entries = 0;
 
-static vfs_s_entry *vfs_s_resolve_symlink (vfs * me, vfs_s_entry * entry,
+static vfs_s_entry *vfs_s_resolve_symlink (struct vfs_class * me, vfs_s_entry * entry,
 					   char *path, int follow);
 
 vfs_s_inode *
-vfs_s_new_inode (vfs *me, vfs_s_super *super, struct stat *initstat)
+vfs_s_new_inode (struct vfs_class *me, vfs_s_super *super, struct stat *initstat)
 {
     vfs_s_inode *ino;
 
@@ -62,7 +62,7 @@ vfs_s_new_inode (vfs *me, vfs_s_super *super, struct stat *initstat)
 }
 
 vfs_s_entry *
-vfs_s_new_entry (vfs *me, char *name, vfs_s_inode *inode)
+vfs_s_new_entry (struct vfs_class *me, char *name, vfs_s_inode *inode)
 {
     vfs_s_entry *entry;
 
@@ -80,7 +80,7 @@ vfs_s_new_entry (vfs *me, char *name, vfs_s_inode *inode)
 }
 
 static void
-vfs_s_free_inode (vfs *me, vfs_s_inode *ino)
+vfs_s_free_inode (struct vfs_class *me, vfs_s_inode *ino)
 {
     if (!ino)
 	vfs_die ("Don't pass NULL to me");
@@ -104,7 +104,7 @@ vfs_s_free_inode (vfs *me, vfs_s_inode *ino)
 }
 
 void
-vfs_s_free_entry (vfs *me, vfs_s_entry *ent)
+vfs_s_free_entry (struct vfs_class *me, vfs_s_entry *ent)
 {
     int is_dot = 0;
     if (ent->prevp){	/* It is possible that we are deleting freshly created entry */
@@ -130,7 +130,7 @@ vfs_s_free_entry (vfs *me, vfs_s_entry *ent)
 }
 
 void
-vfs_s_insert_entry (vfs *me, vfs_s_inode *dir, vfs_s_entry *ent)
+vfs_s_insert_entry (struct vfs_class *me, vfs_s_inode *dir, vfs_s_entry *ent)
 {
     vfs_s_entry **ep;
 
@@ -145,7 +145,7 @@ vfs_s_insert_entry (vfs *me, vfs_s_inode *dir, vfs_s_entry *ent)
 }
 
 struct stat *
-vfs_s_default_stat (vfs *me, mode_t mode)
+vfs_s_default_stat (struct vfs_class *me, mode_t mode)
 {
     static struct stat st;
     int myumask;
@@ -167,7 +167,7 @@ vfs_s_default_stat (vfs *me, mode_t mode)
 }
 
 void
-vfs_s_add_dots (vfs *me, vfs_s_inode *dir, vfs_s_inode *parent)
+vfs_s_add_dots (struct vfs_class *me, vfs_s_inode *dir, vfs_s_inode *parent)
 {
     struct vfs_s_entry *dot, *dotdot;
 
@@ -182,7 +182,7 @@ vfs_s_add_dots (vfs *me, vfs_s_inode *dir, vfs_s_inode *parent)
 }
 
 struct vfs_s_entry *
-vfs_s_generate_entry (vfs *me, char *name, struct vfs_s_inode *parent, mode_t mode)
+vfs_s_generate_entry (struct vfs_class *me, char *name, struct vfs_s_inode *parent, mode_t mode)
 {
     struct vfs_s_inode *inode;
     struct stat *st;
@@ -197,7 +197,7 @@ vfs_s_generate_entry (vfs *me, char *name, struct vfs_s_inode *parent, mode_t mo
 
 /* We were asked to create entries automagically */
 static vfs_s_entry *
-vfs_s_automake (vfs *me, vfs_s_inode *dir, char *path, int flags)
+vfs_s_automake (struct vfs_class *me, vfs_s_inode *dir, char *path, int flags)
 {
     struct vfs_s_entry *res;
     char *sep = strchr (path, PATH_SEP);
@@ -218,7 +218,7 @@ vfs_s_automake (vfs *me, vfs_s_inode *dir, char *path, int flags)
  *       == -1: do not follow links
  */
 vfs_s_entry *
-vfs_s_find_entry_tree (vfs *me, vfs_s_inode *root, char *path, int follow, int flags)
+vfs_s_find_entry_tree (struct vfs_class *me, vfs_s_inode *root, char *path, int follow, int flags)
 {
     unsigned int pseg;
     vfs_s_entry *ent = NULL;
@@ -259,7 +259,7 @@ vfs_s_find_entry_tree (vfs *me, vfs_s_inode *root, char *path, int follow, int f
 }
 
 static void
-split_dir_name (vfs *me, char *path, char **dir, char **name, char **save)
+split_dir_name (struct vfs_class *me, char *path, char **dir, char **name, char **save)
 {
     char *s;
     s = strrchr (path, PATH_SEP);
@@ -276,7 +276,7 @@ split_dir_name (vfs *me, char *path, char **dir, char **name, char **save)
 }
 
 vfs_s_entry *
-vfs_s_find_entry_linear (vfs *me, vfs_s_inode *root, char *path, int follow, int flags)
+vfs_s_find_entry_linear (struct vfs_class *me, vfs_s_inode *root, char *path, int follow, int flags)
 {
     vfs_s_entry* ent = NULL;
 
@@ -332,7 +332,7 @@ vfs_s_find_entry_linear (vfs *me, vfs_s_inode *root, char *path, int follow, int
 }
 
 vfs_s_inode *
-vfs_s_find_inode (vfs *me, vfs_s_inode *root, char *path, int follow, int flags)
+vfs_s_find_inode (struct vfs_class *me, vfs_s_inode *root, char *path, int follow, int flags)
 {
     vfs_s_entry *ent;
     if ((MEDATA->find_entry == vfs_s_find_entry_tree) && (!*path))
@@ -344,7 +344,7 @@ vfs_s_find_inode (vfs *me, vfs_s_inode *root, char *path, int follow, int flags)
 }
 
 static vfs_s_entry *
-vfs_s_resolve_symlink (vfs *me, vfs_s_entry *entry, char *path, int follow)
+vfs_s_resolve_symlink (struct vfs_class *me, vfs_s_entry *entry, char *path, int follow)
 {
     char buf[MC_MAXPATHLEN], *linkname;
 
@@ -402,7 +402,7 @@ vfs_s_resolve_symlink (vfs *me, vfs_s_entry *entry, char *path, int follow)
 /* -------------------------------- superblock games -------------------------- */
 
 static vfs_s_super *
-vfs_s_new_super (vfs *me)
+vfs_s_new_super (struct vfs_class *me)
 {
     vfs_s_super *super;
 
@@ -412,7 +412,7 @@ vfs_s_new_super (vfs *me)
 }
 
 static void
-vfs_s_insert_super (vfs *me, vfs_s_super *super)
+vfs_s_insert_super (struct vfs_class *me, vfs_s_super *super)
 {
     super->next = MEDATA->supers;
     super->prevp = &MEDATA->supers;
@@ -423,7 +423,7 @@ vfs_s_insert_super (vfs *me, vfs_s_super *super)
 } 
 
 static void
-vfs_s_free_super (vfs *me, vfs_s_super *super)
+vfs_s_free_super (struct vfs_class *me, vfs_s_super *super)
 {
     if (super->root){
 	vfs_s_free_inode (me, super->root);
@@ -456,10 +456,10 @@ vfs_s_free_super (vfs *me, vfs_s_super *super)
 /* ------------------------------------------------------------------------= */
 
 static void
-vfs_s_stamp_me (vfs *me, struct vfs_s_super *psup, char *fs_name)
+vfs_s_stamp_me (struct vfs_class *me, struct vfs_s_super *psup, char *fs_name)
 {
     struct vfs_stamping *parent;
-    vfs *v;
+    struct vfs_class *v;
  
     v = vfs_get_class (fs_name);
     if (v->flags & VFSF_LOCAL){
@@ -474,7 +474,7 @@ vfs_s_stamp_me (vfs *me, struct vfs_s_super *psup, char *fs_name)
 }
 
 char *
-vfs_s_get_path_mangle (vfs *me, char *inname, struct vfs_s_super **archive, int flags)
+vfs_s_get_path_mangle (struct vfs_class *me, char *inname, struct vfs_s_super **archive, int flags)
 {
     char *local, *op, *archive_name;
     int result = -1;
@@ -521,7 +521,7 @@ return_success:
 }
 
 static char *
-vfs_s_get_path (vfs *me, const char *inname, struct vfs_s_super **archive, int flags)
+vfs_s_get_path (struct vfs_class *me, const char *inname, struct vfs_s_super **archive, int flags)
 {
     char *buf = g_strdup( inname );
     char *res = vfs_s_get_path_mangle (me, buf, archive, flags);
@@ -532,7 +532,7 @@ vfs_s_get_path (vfs *me, const char *inname, struct vfs_s_super **archive, int f
 }
 
 void
-vfs_s_invalidate (vfs *me, vfs_s_super *super)
+vfs_s_invalidate (struct vfs_class *me, vfs_s_super *super)
 {
     if (!super->want_stale){
 	vfs_s_free_inode (me, super->root);
@@ -541,7 +541,7 @@ vfs_s_invalidate (vfs *me, vfs_s_super *super)
 }
 
 char *
-vfs_s_fullpath (vfs *me, vfs_s_inode *ino)
+vfs_s_fullpath (struct vfs_class *me, vfs_s_inode *ino)
 {
 /* For now, usable only on filesystems with _linear structure */
     if (MEDATA->find_entry != vfs_s_find_entry_linear)
@@ -560,7 +560,7 @@ vfs_s_fullpath (vfs *me, vfs_s_inode *ino)
 /* ------------------------ readdir & friends ----------------------------- */
 
 static vfs_s_inode *
-vfs_s_inode_from_path (vfs *me, char *name, int flags)
+vfs_s_inode_from_path (struct vfs_class *me, char *name, int flags)
 {
     struct vfs_s_super *super;
     struct vfs_s_inode *ino;
@@ -582,7 +582,7 @@ struct dirhandle {
 };
 
 static void *
-vfs_s_opendir (vfs *me, char *dirname)
+vfs_s_opendir (struct vfs_class *me, char *dirname)
 {
     struct vfs_s_inode *dir;
     struct dirhandle *info;
@@ -666,7 +666,7 @@ vfs_s_closedir (void *data)
 }
 
 static int
-vfs_s_chdir (vfs *me, char *path)
+vfs_s_chdir (struct vfs_class *me, char *path)
 {
     void *data;
     if (!(data = vfs_s_opendir (me, path)))
@@ -678,7 +678,7 @@ vfs_s_chdir (vfs *me, char *path)
 /* --------------------------- stat and friends ---------------------------- */
 
 static int
-vfs_s_internal_stat (vfs *me, char *path, struct stat *buf, int flag)
+vfs_s_internal_stat (struct vfs_class *me, char *path, struct stat *buf, int flag)
 {
     struct vfs_s_inode *ino;
 
@@ -689,13 +689,13 @@ vfs_s_internal_stat (vfs *me, char *path, struct stat *buf, int flag)
 }
 
 static int
-vfs_s_stat (vfs *me, char *path, struct stat *buf)
+vfs_s_stat (struct vfs_class *me, char *path, struct stat *buf)
 {
     return vfs_s_internal_stat (me, path, buf, FL_FOLLOW);
 }
 
 static int
-vfs_s_lstat (vfs *me, char *path, struct stat *buf)
+vfs_s_lstat (struct vfs_class *me, char *path, struct stat *buf)
 {
     return vfs_s_internal_stat (me, path, buf, FL_NONE);
 }
@@ -708,7 +708,7 @@ vfs_s_fstat (void *fh, struct stat *buf)
 }
 
 static int
-vfs_s_readlink (vfs *me, char *path, char *buf, int size)
+vfs_s_readlink (struct vfs_class *me, char *path, char *buf, int size)
 {
     struct vfs_s_inode *ino;
 
@@ -728,7 +728,7 @@ vfs_s_readlink (vfs *me, char *path, char *buf, int size)
 }
 
 static void *
-vfs_s_open (vfs *me, char *file, int flags, int mode)
+vfs_s_open (struct vfs_class *me, char *file, int flags, int mode)
 {
     int was_changed = 0;
     struct vfs_s_fh *fh;
@@ -809,7 +809,7 @@ static int
 vfs_s_read (void *fh, char *buffer, int count)
 {
     int n;
-    vfs *me = FH_SUPER->me;
+    struct vfs_class *me = FH_SUPER->me;
 
     if (FH->linear == LS_LINEAR_CLOSED)
         vfs_die ("linear_start() did not set linear_state!");
@@ -831,7 +831,7 @@ static int
 vfs_s_write (void *fh, char *buffer, int count)
 {
     int n;
-    vfs *me = FH_SUPER->me;
+    struct vfs_class *me = FH_SUPER->me;
     
     if (FH->linear)
 	vfs_die ("no writing to linear files, please");
@@ -878,12 +878,12 @@ static int
 vfs_s_close (void *fh)
 {
     int res = 0;
-    vfs *me = FH_SUPER->me;
+    struct vfs_class *me = FH_SUPER->me;
 
     FH_SUPER->fd_usage--;
     if (!FH_SUPER->fd_usage){
         struct vfs_stamping *parent;
-        vfs *v;
+        struct vfs_class *v;
         
 	v = vfs_get_class (FH_SUPER->name);
 	if (v->flags & VFSF_LOCAL) {
@@ -919,7 +919,7 @@ vfs_s_close (void *fh)
 }
 
 int
-vfs_s_retrieve_file (vfs *me, struct vfs_s_inode *ino)
+vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino)
 {
     /* If you want reget, you'll have to open file with O_LINEAR */
     off_t total = 0;
@@ -984,7 +984,7 @@ vfs_s_retrieve_file (vfs *me, struct vfs_s_inode *ino)
 /* ------------------------------- mc support ---------------------------- */
 
 static void
-vfs_s_fill_names (vfs *me, void (*func)(char *))
+vfs_s_fill_names (struct vfs_class *me, void (*func)(char *))
 {
     struct vfs_s_super *a = MEDATA->supers;
     char *name;
@@ -998,13 +998,13 @@ vfs_s_fill_names (vfs *me, void (*func)(char *))
 }
 
 static int
-vfs_s_ferrno (vfs *me)
+vfs_s_ferrno (struct vfs_class *me)
 {
     return me->verrno;
 }
 
 static char *
-vfs_s_getlocalcopy (vfs *me, char *path)
+vfs_s_getlocalcopy (struct vfs_class *me, char *path)
 {
     struct vfs_s_inode *ino;
     char buf[MC_MAXPATHLEN];
@@ -1019,7 +1019,7 @@ vfs_s_getlocalcopy (vfs *me, char *path)
 }
 
 static int 
-vfs_s_setctl (vfs *me, char *path, int ctlop, char *arg)
+vfs_s_setctl (struct vfs_class *me, char *path, int ctlop, char *arg)
 {
     vfs_s_inode *ino = vfs_s_inode_from_path (me, path, 0);
     if (!ino)
@@ -1047,10 +1047,10 @@ vfs_s_setctl (vfs *me, char *path, int ctlop, char *arg)
 /* ----------------------------- Stamping support -------------------------- */
 
 static vfsid
-vfs_s_getid (vfs *me, const char *path, struct vfs_stamping **parent)
+vfs_s_getid (struct vfs_class *me, const char *path, struct vfs_stamping **parent)
 {
     vfs_s_super *archive;
-    vfs *v;
+    struct vfs_class *v;
     char *p;
     vfsid id;
     struct vfs_stamping *par;
@@ -1138,7 +1138,7 @@ vfs_s_select_on_two (int fd1, int fd2)
 }
 
 int
-vfs_s_get_line (vfs *me, int sock, char *buf, int buf_len, char term)
+vfs_s_get_line (struct vfs_class *me, int sock, char *buf, int buf_len, char term)
 {
     FILE *logfile = MEDATA->logfile;
     int i, status;
@@ -1171,7 +1171,7 @@ vfs_s_get_line (vfs *me, int sock, char *buf, int buf_len, char term)
 }
 
 int
-vfs_s_get_line_interruptible (vfs *me, char *buffer, int size, int fd)
+vfs_s_get_line_interruptible (struct vfs_class *me, char *buffer, int size, int fd)
 {
     int n;
     int i;

+ 25 - 25
vfs/extfs.c

@@ -79,7 +79,7 @@ struct pseudofile {
 
 static struct entry *
 find_entry (struct entry *dir, char *name, int make_dirs, int make_file);
-static int extfs_which (vfs *me, char *path);
+static int extfs_which (struct vfs_class *me, char *path);
 static void remove_entry (struct entry *e);
 static void extfs_free (vfsid id);
 
@@ -91,7 +91,7 @@ static char *extfs_prefixes [MAXEXTFS];
 static char extfs_need_archive [MAXEXTFS];
 static int extfs_no = 0;
 
-static void extfs_fill_names (vfs *me, void (*func)(char *))
+static void extfs_fill_names (struct vfs_class *me, void (*func)(char *))
 {
     struct archive *a = first_archive;
     char *name;
@@ -418,7 +418,7 @@ get_path_mangle (char *inname, struct archive **archive, int is_dir,
     int result = -1;
     struct archive *parc;
     struct vfs_stamping *parent;
-    vfs *v;
+    struct vfs_class *v;
     int fstype;
 
     archive_name = inname;
@@ -426,7 +426,7 @@ get_path_mangle (char *inname, struct archive **archive, int is_dir,
 
     /*
      * FIXME: we really should pass self pointer. But as we know that
-     * extfs_which does not touch vfs *me, it does not matter for now
+     * extfs_which does not touch struct vfs_class *me, it does not matter for now
      */
     fstype = extfs_which (NULL, op);
 
@@ -641,7 +641,7 @@ extfs_run (char *file)
 }
 
 static void *
-extfs_open (vfs *me, char *file, int flags, int mode)
+extfs_open (struct vfs_class *me, char *file, int flags, int mode)
 {
     struct pseudofile *extfs_info;
     struct archive *archive;
@@ -747,7 +747,7 @@ extfs_close (void *data)
     file->archive->fd_usage--;
     if (!file->archive->fd_usage) {
 	struct vfs_stamping *parent;
-	vfs *v;
+	struct vfs_class *v;
 
 	if (!file->archive->name || !*file->archive->name
 	    || (v =
@@ -863,12 +863,12 @@ static struct entry *find_entry (struct entry *dir, char *name, int make_dirs, i
 }
 
 
-static int s_errno (vfs *me)
+static int s_errno (struct vfs_class *me)
 {
     return my_errno;
 }
 
-static void * s_opendir (vfs *me, char *dirname)
+static void * s_opendir (struct vfs_class *me, char *dirname)
 {
     struct archive *archive;
     char *q;
@@ -980,12 +980,12 @@ static int s_internal_stat (char *path, struct stat *buf, int resolve)
     return 0;
 }
 
-static int s_stat (vfs *me, char *path, struct stat *buf)
+static int s_stat (struct vfs_class *me, char *path, struct stat *buf)
 {
     return s_internal_stat (path, buf, 1);
 }
 
-static int s_lstat (vfs *me, char *path, struct stat *buf)
+static int s_lstat (struct vfs_class *me, char *path, struct stat *buf)
 {
     return s_internal_stat (path, buf, 0);
 }
@@ -1001,7 +1001,7 @@ static int s_fstat (void *data, struct stat *buf)
 }
 
 static int
-s_readlink (vfs *me, char *path, char *buf, int size)
+s_readlink (struct vfs_class *me, char *path, char *buf, int size)
 {
     struct archive *archive;
     char *q;
@@ -1022,7 +1022,7 @@ s_readlink (vfs *me, char *path, char *buf, int size)
     return i;
 }
 
-static int extfs_chmod (vfs *me, char *path, int mode)
+static int extfs_chmod (struct vfs_class *me, char *path, int mode)
 {
     return 0;
 }
@@ -1035,7 +1035,7 @@ static int extfs_write (void *data, char *buf, int nbyte)
     return write (file->local_handle, buf, nbyte);
 }
 
-static int extfs_unlink (vfs *me, char *file)
+static int extfs_unlink (struct vfs_class *me, char *file)
 {
     struct archive *archive;
     char *q;
@@ -1059,7 +1059,7 @@ static int extfs_unlink (vfs *me, char *file)
     return 0;
 }
 
-static int extfs_mkdir (vfs *me, char *path, mode_t mode)
+static int extfs_mkdir (struct vfs_class *me, char *path, mode_t mode)
 {
     struct archive *archive;
     char *q;
@@ -1085,7 +1085,7 @@ static int extfs_mkdir (vfs *me, char *path, mode_t mode)
     return 0;
 }
 
-static int extfs_rmdir (vfs *me, char *path)
+static int extfs_rmdir (struct vfs_class *me, char *path)
 {
     struct archive *archive;
     char *q;
@@ -1109,7 +1109,7 @@ static int extfs_rmdir (vfs *me, char *path)
     return 0;
 }
 
-static int extfs_chdir (vfs *me, char *path)
+static int extfs_chdir (struct vfs_class *me, char *path)
 {
     struct archive *archive;
     char *q;
@@ -1136,10 +1136,10 @@ static int extfs_lseek (void *data, off_t offset, int whence)
     return lseek (file->local_handle, offset, whence);
 }
 
-static vfsid extfs_getid (vfs *me, const char *path, struct vfs_stamping **parent)
+static vfsid extfs_getid (struct vfs_class *me, const char *path, struct vfs_stamping **parent)
 {
     struct archive *archive;
-    vfs *v;
+    struct vfs_class *v;
     vfsid id;
     struct vfs_stamping *par;
     char *p;
@@ -1251,7 +1251,7 @@ static void extfs_free (vfsid id)
     free_archive (archive);
 }
 
-static char *extfs_getlocalcopy (vfs *me, char *path)
+static char *extfs_getlocalcopy (struct vfs_class *me, char *path)
 {
     struct pseudofile *fp = 
         (struct pseudofile *) extfs_open (me, path, O_RDONLY, 0);
@@ -1269,7 +1269,7 @@ static char *extfs_getlocalcopy (vfs *me, char *path)
     return p;
 }
 
-static int extfs_ungetlocalcopy (vfs *me, char *path, char *local, int has_changed)
+static int extfs_ungetlocalcopy (struct vfs_class *me, char *path, char *local, int has_changed)
 {
     struct pseudofile *fp = 
         (struct pseudofile *) extfs_open (me, path, O_RDONLY, 0);
@@ -1289,7 +1289,7 @@ static int extfs_ungetlocalcopy (vfs *me, char *path, char *local, int has_chang
 }
 
 
-static int extfs_init (vfs *me)
+static int extfs_init (struct vfs_class *me)
 {
     FILE *cfg;
     char *mc_extfsini;
@@ -1349,7 +1349,7 @@ static int extfs_init (vfs *me)
 }
 
 /* Do NOT use me argument in this function */
-static int extfs_which (vfs *me, char *path)
+static int extfs_which (struct vfs_class *me, char *path)
 {
     int i;
 
@@ -1359,7 +1359,7 @@ static int extfs_which (vfs *me, char *path)
     return -1;
 }
 
-static void extfs_done (vfs *me)
+static void extfs_done (struct vfs_class *me)
 {
     int i;
 
@@ -1368,7 +1368,7 @@ static void extfs_done (vfs *me)
     extfs_no = 0;
 }
 
-static int extfs_setctl (vfs *me, char *path, int ctlop, char *arg)
+static int extfs_setctl (struct vfs_class *me, char *path, int ctlop, char *arg)
 {
     if (ctlop == MCCTL_EXTFS_RUN) {
         extfs_run (path);
@@ -1377,7 +1377,7 @@ static int extfs_setctl (vfs *me, char *path, int ctlop, char *arg)
     return 0;
 }
 
-vfs vfs_extfs_ops = {
+struct vfs_class vfs_extfs_ops = {
     NULL,	/* This is place of next pointer */
     "extfs",
     0,		/* flags */

+ 25 - 25
vfs/fish.c

@@ -80,7 +80,7 @@ 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, ...)
+command (struct vfs_class *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
     __attribute__ ((format (printf, 4, 5)));
 
 static int decode_reply (char *s, int was_garbage)
@@ -95,7 +95,7 @@ static int decode_reply (char *s, int was_garbage)
 }
 
 /* Returns a reply code, check /usr/include/arpa/ftp.h for possible values */
-static int get_reply (vfs *me, int sock, char *string_buf, int string_len)
+static int get_reply (struct vfs_class *me, int sock, char *string_buf, int string_len)
 {
     char answer[1024];
     int was_garbage = 0;
@@ -119,7 +119,7 @@ static int get_reply (vfs *me, int sock, char *string_buf, int string_len)
 #define SUP super->u.fish
 
 static int
-command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
+command (struct vfs_class *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
 {
     va_list ap;
     char *str;
@@ -151,7 +151,7 @@ command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
 }
 
 static void
-free_archive (vfs *me, vfs_s_super *super)
+free_archive (struct vfs_class *me, vfs_s_super *super)
 {
     if ((SUP.sockw != -1) || (SUP.sockr != -1)){
 	print_vfs_message (_("fish: Disconnecting from %s"), super->name?super->name:"???");
@@ -197,14 +197,14 @@ pipeopen(vfs_s_super *super, char *path, char *argv[])
 }
 
 /* The returned directory should always contain a trailing slash */
-static char *fish_getcwd(vfs *me, vfs_s_super *super)
+static char *fish_getcwd(struct vfs_class *me, vfs_s_super *super)
 {
     if (command(me, super, WANT_STRING, "#PWD\npwd; echo '### 200'\n") == COMPLETE)
         return  g_strconcat (reply_str, "/", NULL);
     ERRNOR (EIO, NULL);
 }
 static int
-open_archive_int (vfs *me, vfs_s_super *super)
+open_archive_int (struct vfs_class *me, vfs_s_super *super)
 {
     char *argv[100];
     char *xsh = (SUP.flags == FISH_FLAG_RSH ? "rsh" : "ssh");
@@ -295,7 +295,7 @@ open_archive_int (vfs *me, vfs_s_super *super)
 }
 
 static int
-open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
+open_archive (struct vfs_class *me, vfs_s_super *super, char *archive_name, char *op)
 {
     char *host, *user, *password, *p;
     int flags;
@@ -317,7 +317,7 @@ open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
 }
 
 static int
-archive_same(vfs *me, vfs_s_super *super, char *archive_name, char *op, void *cookie)
+archive_same(struct vfs_class *me, vfs_s_super *super, char *archive_name, char *op, void *cookie)
 {	
     char *host, *user;
     int flags;
@@ -337,7 +337,7 @@ archive_same(vfs *me, vfs_s_super *super, char *archive_name, char *op, void *co
 }
 
 static int
-dir_uptodate(vfs *me, vfs_s_inode *ino)
+dir_uptodate(struct vfs_class *me, vfs_s_inode *ino)
 {
     struct timeval tim;
 
@@ -352,7 +352,7 @@ dir_uptodate(vfs *me, vfs_s_inode *ino)
 }
 
 static int
-dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
+dir_load(struct vfs_class *me, vfs_s_inode *dir, char *remote_path)
 {
     vfs_s_super *super = dir->super;
     char buffer[8192];
@@ -475,7 +475,7 @@ error:
 }
 
 static int
-file_store(vfs *me, vfs_s_fh *fh, char *name, char *localname)
+file_store(struct vfs_class *me, vfs_s_fh *fh, char *name, char *localname)
 {
     vfs_s_super *super = FH_SUPER;
     int n, total;
@@ -562,7 +562,7 @@ error_return:
     return -1;
 }
 
-static int linear_start(vfs *me, vfs_s_fh *fh, int offset)
+static int linear_start(struct vfs_class *me, vfs_s_fh *fh, int offset)
 {
     char *name;
     char *quoted_name;
@@ -596,7 +596,7 @@ static int linear_start(vfs *me, vfs_s_fh *fh, int offset)
 }
 
 static void
-linear_abort (vfs *me, vfs_s_fh *fh)
+linear_abort (struct vfs_class *me, vfs_s_fh *fh)
 {
     vfs_s_super *super = FH_SUPER;
     char buffer[8192];
@@ -617,7 +617,7 @@ linear_abort (vfs *me, vfs_s_fh *fh)
 }
 
 static int
-linear_read (vfs *me, vfs_s_fh *fh, void *buf, int len)
+linear_read (struct vfs_class *me, vfs_s_fh *fh, void *buf, int len)
 {
     vfs_s_super *super = FH_SUPER;
     int n = 0;
@@ -638,7 +638,7 @@ linear_read (vfs *me, vfs_s_fh *fh, void *buf, int len)
 }
 
 static void
-linear_close (vfs *me, vfs_s_fh *fh)
+linear_close (struct vfs_class *me, vfs_s_fh *fh)
 {
     if (fh->u.fish.total != fh->u.fish.got)
 	linear_abort(me, fh);
@@ -671,7 +671,7 @@ fish_ctl (void *fh, int ctlop, int arg)
 }
 
 static int
-send_fish_command(vfs *me, vfs_s_super *super, char *cmd, int flags)
+send_fish_command(struct vfs_class *me, vfs_s_super *super, char *cmd, int flags)
 {
     int r;
 
@@ -696,7 +696,7 @@ send_fish_command(vfs *me, vfs_s_super *super, char *cmd, int flags)
     return send_fish_command(me, super, buf, flags);
 
 static int
-fish_chmod (vfs *me, char *path, int mode)
+fish_chmod (struct vfs_class *me, char *path, int mode)
 {
     PREFIX
     g_snprintf(buf, sizeof(buf), "#CHMOD %4.4o /%s\n"
@@ -708,7 +708,7 @@ fish_chmod (vfs *me, char *path, int mode)
 }
 
 #define FISH_OP(name, chk, string) \
-static int fish_##name (vfs *me, char *path1, char *path2) \
+static int fish_##name (struct vfs_class *me, char *path1, char *path2) \
 { \
     char buf[BUF_LARGE]; \
     char *rpath1, *rpath2; \
@@ -733,7 +733,7 @@ FISH_OP(link,   XTEST, "#LINK /%s /%s\n"
 		       "ln /%s /%s 2>/dev/null\n"
 		       "echo '### 000'" )
 
-static int fish_symlink (vfs *me, char *setto, char *path)
+static int fish_symlink (struct vfs_class *me, char *setto, char *path)
 {
     PREFIX
     setto = name_quote (setto, 0);
@@ -747,7 +747,7 @@ static int fish_symlink (vfs *me, char *setto, char *path)
 }
 
 static int
-fish_chown (vfs *me, char *path, int owner, int group)
+fish_chown (struct vfs_class *me, char *path, int owner, int group)
 {
     char *sowner, *sgroup;
     struct passwd *pw;
@@ -780,7 +780,7 @@ fish_chown (vfs *me, char *path, int owner, int group)
     POSTFIX(OPT_FLUSH)
 }
 
-static int fish_unlink (vfs *me, char *path)
+static int fish_unlink (struct vfs_class *me, char *path)
 {
     PREFIX
     g_snprintf(buf, sizeof(buf),
@@ -791,7 +791,7 @@ static int fish_unlink (vfs *me, char *path)
     POSTFIX(OPT_FLUSH);
 }
 
-static int fish_mkdir (vfs *me, char *path, mode_t mode)
+static int fish_mkdir (struct vfs_class *me, char *path, mode_t mode)
 {
     PREFIX
     g_snprintf(buf, sizeof(buf),
@@ -802,7 +802,7 @@ static int fish_mkdir (vfs *me, char *path, mode_t mode)
     POSTFIX(OPT_FLUSH);
 }
 
-static int fish_rmdir (vfs *me, char *path)
+static int fish_rmdir (struct vfs_class *me, char *path)
 {
     PREFIX
     g_snprintf(buf, sizeof(buf),
@@ -813,7 +813,7 @@ static int fish_rmdir (vfs *me, char *path)
     POSTFIX(OPT_FLUSH);
 }
 
-static int fish_fh_open (vfs *me, vfs_s_fh *fh, int flags, int mode)
+static int fish_fh_open (struct vfs_class *me, vfs_s_fh *fh, int flags, int mode)
 {
     fh->u.fish.append = 0;
     /* File will be written only, so no need to retrieve it */
@@ -864,7 +864,7 @@ static struct vfs_s_data fish_data = {
 };
 
 static void
-fish_fill_names (vfs *me, void (*func)(char *))
+fish_fill_names (struct vfs_class *me, void (*func)(char *))
 {
     struct vfs_s_super * super = fish_data.supers;
     char *flags;

+ 43 - 43
vfs/ftpfs.c

@@ -156,16 +156,16 @@ static struct vfs_class vfs_ftpfs_ops;
    c) strip trailing "/."
  */
 
-static char *ftpfs_get_current_directory (vfs *me, vfs_s_super *super);
-static int ftpfs_chdir_internal (vfs *me, vfs_s_super *super, char *remote_path);
-static int command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
+static char *ftpfs_get_current_directory (struct vfs_class *me, vfs_s_super *super);
+static int ftpfs_chdir_internal (struct vfs_class *me, vfs_s_super *super, char *remote_path);
+static int command (struct vfs_class *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
     __attribute__ ((format (printf, 4, 5)));
-static int ftpfs_open_socket (vfs *me, vfs_s_super *super);
-static int login_server (vfs *me, vfs_s_super *super, const char *netrcpass);
+static int ftpfs_open_socket (struct vfs_class *me, vfs_s_super *super);
+static int login_server (struct vfs_class *me, vfs_s_super *super, const char *netrcpass);
 static int lookup_netrc (const char *host, char **login, char **pass);
 
 static char *
-translate_path (vfs *me, vfs_s_super *super, const char *remote_path)
+translate_path (struct vfs_class *me, vfs_s_super *super, const char *remote_path)
 {
     if (!SUP.remote_is_amiga)
 	return g_strdup (remote_path);
@@ -253,7 +253,7 @@ ftp_split_url(char *path, char **host, char **user, int *port, char **pass)
 
 /* Returns a reply code, check /usr/include/arpa/ftp.h for possible values */
 static int
-get_reply (vfs *me, int sock, char *string_buf, int string_len)
+get_reply (struct vfs_class *me, int sock, char *string_buf, int string_len)
 {
     char answer[BUF_1K];
     int i;
@@ -297,7 +297,7 @@ get_reply (vfs *me, int sock, char *string_buf, int string_len)
 }
 
 static int
-reconnect (vfs *me, vfs_s_super *super)
+reconnect (struct vfs_class *me, vfs_s_super *super)
 {
     int sock = ftpfs_open_socket (me, super);
     if (sock != -1){
@@ -318,7 +318,7 @@ reconnect (vfs *me, vfs_s_super *super)
 }
 
 static int
-command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
+command (struct vfs_class *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
 {
     va_list ap;
     char *cmdstr;
@@ -378,7 +378,7 @@ command (vfs *me, vfs_s_super *super, int wait_reply, const char *fmt, ...)
 }
 
 static void
-free_archive (vfs *me, vfs_s_super *super)
+free_archive (struct vfs_class *me, vfs_s_super *super)
 {
     if (SUP.sock != -1){
 	print_vfs_message (_("ftpfs: Disconnecting from %s"), SUP.host);
@@ -401,7 +401,7 @@ free_archive (vfs *me, vfs_s_super *super)
 #define TYPE_UNKNOWN -1 
 
 static int
-changetype (vfs *me, vfs_s_super *super, int binary)
+changetype (struct vfs_class *me, vfs_s_super *super, int binary)
 {
     if (binary != SUP.isbinary) {
         if (command (me, super, WAIT_REPLY, "TYPE %c", binary ? 'I' : 'A') != COMPLETE)
@@ -413,7 +413,7 @@ changetype (vfs *me, vfs_s_super *super, int binary)
 
 /* This routine logs the user in */
 static int
-login_server (vfs *me, vfs_s_super *super, const char *netrcpass)
+login_server (struct vfs_class *me, vfs_s_super *super, const char *netrcpass)
 {
     char *pass;
     char *op;
@@ -653,7 +653,7 @@ ftpfs_get_proxy_host_and_port (const char *proxy, char **host, int *port)
 }
 
 static int
-ftpfs_open_socket (vfs *me, vfs_s_super *super)
+ftpfs_open_socket (struct vfs_class *me, vfs_s_super *super)
 {
     struct   sockaddr_in server_address;
     struct   hostent *hp;
@@ -730,7 +730,7 @@ ftpfs_open_socket (vfs *me, vfs_s_super *super)
 }
 
 static int
-open_archive_int (vfs *me, vfs_s_super *super)
+open_archive_int (struct vfs_class *me, vfs_s_super *super)
 {
     int retry_seconds, count_down;
 
@@ -780,7 +780,7 @@ open_archive_int (vfs *me, vfs_s_super *super)
 }
 
 static int
-open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
+open_archive (struct vfs_class *me, vfs_s_super *super, char *archive_name, char *op)
 {
     char *host, *user, *password;
     int port;
@@ -807,7 +807,7 @@ open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
 }
 
 static int
-archive_same(vfs *me, vfs_s_super *super, char *archive_name, char *op, void *cookie)
+archive_same(struct vfs_class *me, vfs_s_super *super, char *archive_name, char *op, void *cookie)
 {	
     char *host, *user;
     int port;
@@ -831,7 +831,7 @@ ftpfs_flushdir (void)
 }
 
 static int
-dir_uptodate(vfs *me, vfs_s_inode *ino)
+dir_uptodate(struct vfs_class *me, vfs_s_inode *ino)
 {
     struct timeval tim;
 
@@ -847,7 +847,7 @@ dir_uptodate(vfs *me, vfs_s_inode *ino)
 
 /* The returned directory should always contain a trailing slash */
 static char *
-ftpfs_get_current_directory (vfs *me, vfs_s_super *super)
+ftpfs_get_current_directory (struct vfs_class *me, vfs_s_super *super)
 {
     char buf[BUF_8K], *bufp, *bufq;
 
@@ -887,7 +887,7 @@ ftpfs_get_current_directory (vfs *me, vfs_s_super *super)
     
 /* Setup Passive ftp connection, we use it for source routed connections */
 static int
-setup_passive (vfs *me, vfs_s_super *super, int my_socket, struct sockaddr_in *sa)
+setup_passive (struct vfs_class *me, vfs_s_super *super, int my_socket, struct sockaddr_in *sa)
 {
     int xa, xb, xc, xd, xe, xf;
     char n [6];
@@ -921,7 +921,7 @@ setup_passive (vfs *me, vfs_s_super *super, int my_socket, struct sockaddr_in *s
 }
 
 static int
-initconn (vfs *me, vfs_s_super *super)
+initconn (struct vfs_class *me, vfs_s_super *super)
 {
     struct sockaddr_in data_addr;
     int data;
@@ -972,7 +972,7 @@ again:
 }
 
 static int
-open_data_connection (vfs *me, vfs_s_super *super, const char *cmd,
+open_data_connection (struct vfs_class *me, vfs_s_super *super, const char *cmd,
 		      const char *remote, int isbinary, int reget)
 {
     struct sockaddr_in from;
@@ -1015,7 +1015,7 @@ open_data_connection (vfs *me, vfs_s_super *super, const char *cmd,
 
 #define ABORT_TIMEOUT 5
 static void
-linear_abort (vfs *me, vfs_s_fh *fh)
+linear_abort (struct vfs_class *me, vfs_s_fh *fh)
 {
     vfs_s_super *super = FH_SUPER;
     static unsigned char const ipbuf[3] = { IAC, IP, IAC };
@@ -1065,7 +1065,7 @@ linear_abort (vfs *me, vfs_s_fh *fh)
 
 #if 0
 static void
-resolve_symlink_without_ls_options(vfs *me, vfs_s_super *super, vfs_s_inode *dir)
+resolve_symlink_without_ls_options(struct vfs_class *me, vfs_s_super *super, vfs_s_inode *dir)
 {
     struct linklist *flist;
     struct direntry *fe, *fel;
@@ -1126,7 +1126,7 @@ resolve_symlink_without_ls_options(vfs *me, vfs_s_super *super, vfs_s_inode *dir
 }
 
 static void
-resolve_symlink_with_ls_options(vfs *me, vfs_s_super *super, vfs_s_inode *dir)
+resolve_symlink_with_ls_options(struct vfs_class *me, vfs_s_super *super, vfs_s_inode *dir)
 {
     char  buffer[2048] = "", *filename;
     int sock;
@@ -1205,7 +1205,7 @@ done:
 }
 
 static void
-resolve_symlink(vfs *me, vfs_s_super *super, vfs_s_inode *dir)
+resolve_symlink(struct vfs_class *me, vfs_s_super *super, vfs_s_inode *dir)
 {
     print_vfs_message(_("Resolving symlink..."));
 
@@ -1217,7 +1217,7 @@ resolve_symlink(vfs *me, vfs_s_super *super, vfs_s_inode *dir)
 #endif
 
 static int
-dir_load (vfs *me, vfs_s_inode *dir, char *remote_path)
+dir_load (struct vfs_class *me, vfs_s_inode *dir, char *remote_path)
 {
     vfs_s_entry *ent;
     vfs_s_super *super = dir->super;
@@ -1373,7 +1373,7 @@ fallback:
 }
 
 static int
-file_store(vfs *me, vfs_s_fh *fh, char *name, char *localname)
+file_store(struct vfs_class *me, vfs_s_fh *fh, char *name, char *localname)
 {
     int h, sock, n;
     off_t total;
@@ -1451,7 +1451,7 @@ error_return:
 }
 
 static int 
-linear_start(vfs *me, vfs_s_fh *fh, int offset)
+linear_start(struct vfs_class *me, vfs_s_fh *fh, int offset)
 {
     char *name = vfs_s_fullpath (me, fh->ino);
 
@@ -1468,7 +1468,7 @@ linear_start(vfs *me, vfs_s_fh *fh, int offset)
 }
 
 static int
-linear_read (vfs *me, vfs_s_fh *fh, void *buf, int len)
+linear_read (struct vfs_class *me, vfs_s_fh *fh, void *buf, int len)
 {
     int n;
     vfs_s_super *super = FH_SUPER;
@@ -1494,7 +1494,7 @@ linear_read (vfs *me, vfs_s_fh *fh, void *buf, int len)
 }
 
 static void
-linear_close (vfs *me, vfs_s_fh *fh)
+linear_close (struct vfs_class *me, vfs_s_fh *fh)
 {
     if (FH_SOCK != -1)
         linear_abort(me, fh);
@@ -1524,7 +1524,7 @@ static int ftpfs_ctl (void *fh, int ctlop, int arg)
 
 /* Warning: filename passed to this command is damaged */
 static int
-send_ftp_command(vfs *me, char *filename, char *cmd, int flags)
+send_ftp_command(struct vfs_class *me, char *filename, char *cmd, int flags)
 {
     char *rpath, *p;
     vfs_s_super *super;
@@ -1565,7 +1565,7 @@ ftpfs_init_passwd(void)
     ftpfs_anonymous_passwd = g_strdup ("anonymous@");
 }
 
-static int ftpfs_chmod (vfs *me, char *path, int mode)
+static int ftpfs_chmod (struct vfs_class *me, char *path, int mode)
 {
     char buf[BUF_SMALL];
 
@@ -1573,7 +1573,7 @@ static int ftpfs_chmod (vfs *me, char *path, int mode)
     return send_ftp_command(me, path, buf, OPT_FLUSH);
 }
 
-static int ftpfs_chown (vfs *me, char *path, int owner, int group)
+static int ftpfs_chown (struct vfs_class *me, char *path, int owner, int group)
 {
 #if 0
     my_errno = EPERM;
@@ -1585,14 +1585,14 @@ static int ftpfs_chown (vfs *me, char *path, int owner, int group)
 #endif    
 }
 
-static int ftpfs_unlink (vfs *me, char *path)
+static int ftpfs_unlink (struct vfs_class *me, char *path)
 {
     return send_ftp_command(me, path, "DELE /%s", OPT_FLUSH);
 }
 
 /* Return 1 if path is the same directory as the one we are in now */
 static int
-is_same_dir (vfs *me, vfs_s_super *super, const char *path)
+is_same_dir (struct vfs_class *me, vfs_s_super *super, const char *path)
 {
     if (!SUP.cwdir)
 	return 0;
@@ -1602,7 +1602,7 @@ is_same_dir (vfs *me, vfs_s_super *super, const char *path)
 }
 
 static int
-ftpfs_chdir_internal (vfs *me, vfs_s_super *super, char *remote_path)
+ftpfs_chdir_internal (struct vfs_class *me, vfs_s_super *super, char *remote_path)
 {
     int r;
     char *p;
@@ -1624,23 +1624,23 @@ ftpfs_chdir_internal (vfs *me, vfs_s_super *super, char *remote_path)
     return r;
 }
 
-static int ftpfs_rename (vfs *me, char *path1, char *path2)
+static int ftpfs_rename (struct vfs_class *me, char *path1, char *path2)
 {
     send_ftp_command(me, path1, "RNFR /%s", OPT_FLUSH);
     return send_ftp_command(me, path2, "RNTO /%s", OPT_FLUSH);
 }
 
-static int ftpfs_mkdir (vfs *me, char *path, mode_t mode)
+static int ftpfs_mkdir (struct vfs_class *me, char *path, mode_t mode)
 {
     return send_ftp_command(me, path, "MKD /%s", OPT_FLUSH);
 }
 
-static int ftpfs_rmdir (vfs *me, char *path)
+static int ftpfs_rmdir (struct vfs_class *me, char *path)
 {
     return send_ftp_command(me, path, "RMD /%s", OPT_FLUSH);
 }
 
-static int ftpfs_fh_open (vfs *me, vfs_s_fh *fh, int flags, int mode)
+static int ftpfs_fh_open (struct vfs_class *me, vfs_s_fh *fh, int flags, int mode)
 {
     fh->u.ftp.append = 0;
     /* File will be written only, so no need to retrieve it from ftp server */
@@ -1697,7 +1697,7 @@ static int ftpfs_fh_open (vfs *me, vfs_s_fh *fh, int flags, int mode)
     return 0;
 }
 
-static int ftpfs_fh_close (vfs *me, vfs_s_fh *fh)
+static int ftpfs_fh_close (struct vfs_class *me, vfs_s_fh *fh)
 {
     if (fh->handle != -1 && !fh->ino->localname){
 	close (fh->handle);
@@ -1742,7 +1742,7 @@ static struct vfs_s_data ftp_data = {
 };
 
 static void
-ftpfs_done (vfs *me)
+ftpfs_done (struct vfs_class *me)
 {
     struct no_proxy_entry *np;
 
@@ -1757,7 +1757,7 @@ ftpfs_done (vfs *me)
 }
 
 static void
-ftpfs_fill_names (vfs *me, void (*func)(char *))
+ftpfs_fill_names (struct vfs_class *me, void (*func)(char *))
 {
     struct vfs_s_super * super = ftp_data.supers;
     char *name;

+ 24 - 24
vfs/local.c

@@ -17,7 +17,7 @@
  * */
     
 static void *
-local_open (vfs *me, char *file, int flags, int mode)
+local_open (struct vfs_class *me, char *file, int flags, int mode)
 {
     int *local_info;
     int fd;
@@ -66,13 +66,13 @@ local_close (void *data)
 }
 
 int
-local_errno (vfs *me)
+local_errno (struct vfs_class *me)
 {
     return errno;
 }
 
 static void *
-local_opendir (vfs *me, char *dirname)
+local_opendir (struct vfs_class *me, char *dirname)
 {
     DIR **local_info;
     DIR *dir;
@@ -128,13 +128,13 @@ local_closedir (void *data)
 }
 
 static int
-local_stat (vfs *me, char *path, struct stat *buf)
+local_stat (struct vfs_class *me, char *path, struct stat *buf)
 {
     return stat (path, buf);
 }
 
 static int
-local_lstat (vfs *me, char *path, struct stat *buf)
+local_lstat (struct vfs_class *me, char *path, struct stat *buf)
 {
 #ifndef HAVE_STATLSTAT
     return lstat (path,buf);
@@ -150,37 +150,37 @@ local_fstat (void *data, struct stat *buf)
 }
 
 static int
-local_chmod (vfs *me, char *path, int mode)
+local_chmod (struct vfs_class *me, char *path, int mode)
 {
     return chmod (path, mode);
 }
 
 static int
-local_chown (vfs *me, char *path, int owner, int group)
+local_chown (struct vfs_class *me, char *path, int owner, int group)
 {
     return chown (path, owner, group);
 }
 
 static int
-local_utime (vfs *me, char *path, struct utimbuf *times)
+local_utime (struct vfs_class *me, char *path, struct utimbuf *times)
 {
     return utime (path, times);
 }
 
 static int
-local_readlink (vfs *me, char *path, char *buf, int size)
+local_readlink (struct vfs_class *me, char *path, char *buf, int size)
 {
     return readlink (path, buf, size);
 }
 
 static int
-local_unlink (vfs *me, char *path)
+local_unlink (struct vfs_class *me, char *path)
 {
     return unlink (path);
 }
 
 static int
-local_symlink (vfs *me, char *n1, char *n2)
+local_symlink (struct vfs_class *me, char *n1, char *n2)
 {
     return symlink (n1, n2);
 }
@@ -208,13 +208,13 @@ local_write (void *data, char *buf, int nbyte)
 }
 
 static int
-local_rename (vfs *me, char *a, char *b)
+local_rename (struct vfs_class *me, char *a, char *b)
 {
     return rename (a, b);
 }
 
 static int
-local_chdir (vfs *me, char *path)
+local_chdir (struct vfs_class *me, char *path)
 {
     return chdir (path);
 }
@@ -228,31 +228,31 @@ local_lseek (void *data, off_t offset, int whence)
 }
 
 static int
-local_mknod (vfs *me, char *path, int mode, int dev)
+local_mknod (struct vfs_class *me, char *path, int mode, int dev)
 {
     return mknod (path, mode, dev);
 }
 
 static int
-local_link (vfs *me, char *p1, char *p2)
+local_link (struct vfs_class *me, char *p1, char *p2)
 {
     return link (p1, p2);
 }
 
 static int
-local_mkdir (vfs *me, char *path, mode_t mode)
+local_mkdir (struct vfs_class *me, char *path, mode_t mode)
 {
     return mkdir (path, mode);
 }
 
 static int
-local_rmdir (vfs *me, char *path)
+local_rmdir (struct vfs_class *me, char *path)
 {
     return rmdir (path);
 }
 
 static vfsid
-local_getid (vfs *me, const char *path, struct vfs_stamping **parent)
+local_getid (struct vfs_class *me, const char *path, struct vfs_stamping **parent)
 {
     *parent = NULL;
     return (vfsid) -1; /* We do not free local fs stuff at all */
@@ -270,20 +270,20 @@ local_free (vfsid id)
 }
 
 static char *
-local_getlocalcopy (vfs *me, char *path)
+local_getlocalcopy (struct vfs_class *me, char *path)
 {
     return g_strdup (path);
 }
 
 static int
-local_ungetlocalcopy (vfs *me, char *path, char *local, int has_changed)
+local_ungetlocalcopy (struct vfs_class *me, char *path, char *local, int has_changed)
 {
     return 0;
 }
 
 #ifdef HAVE_MMAP
 caddr_t
-local_mmap (vfs *me, caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset)
+local_mmap (struct vfs_class *me, caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset)
 {
     int fd = * (int *)data;
 
@@ -291,19 +291,19 @@ local_mmap (vfs *me, caddr_t addr, size_t len, int prot, int flags, void *data,
 }
 
 int
-local_munmap (vfs *me, caddr_t addr, size_t len, void *data)
+local_munmap (struct vfs_class *me, caddr_t addr, size_t len, void *data)
 {
     return munmap (addr, len);
 }
 #endif
 
 static int
-local_which (vfs *me, char *path)
+local_which (struct vfs_class *me, char *path)
 {
     return 0;		/* Every path which other systems do not like is expected to be ours */
 }
 
-vfs vfs_local_ops = {
+struct vfs_class vfs_local_ops = {
     NULL,	/* This is place of next pointer */
     "localfs",
     VFSF_LOCAL,	/* flags */

+ 3 - 3
vfs/local.h

@@ -4,11 +4,11 @@
 extern int local_close (void *data);
 extern int local_read (void *data, char *buffer, int count);
 extern int local_fstat (void *data, struct stat *buf);
-extern int local_errno (vfs *me);
+extern int local_errno (struct vfs_class *me);
 extern int local_lseek (void *data, off_t offset, int whence);
 #ifdef HAVE_MMAP
-extern caddr_t local_mmap (vfs *me, caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset);
-extern int local_munmap (vfs *me, caddr_t addr, size_t len, void *data);
+extern caddr_t local_mmap (struct vfs_class *me, caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset);
+extern int local_munmap (struct vfs_class *me, caddr_t addr, size_t len, void *data);
 #endif
 
 #endif

+ 21 - 21
vfs/mcfs.c

@@ -91,7 +91,7 @@ mcfs_get_host_and_username (char *path, char **host, char **user,
 }
 
 static void
-mcfs_fill_names (vfs *me, void (*func) (char *))
+mcfs_fill_names (struct vfs_class *me, void (*func) (char *))
 {
     int i;
     char *name;
@@ -511,7 +511,7 @@ mcfs_gethome (mcfs_connection *mc)
 
 /* The callbacks */
 static void *
-mcfs_open (vfs *me, char *file, int flags, int mode)
+mcfs_open (struct vfs_class *me, char *file, int flags, int mode)
 {
     char *remote_file;
     mcfs_connection *mc;
@@ -610,7 +610,7 @@ mcfs_close (void *data)
 }
 
 static int
-mcfs_errno (vfs *me)
+mcfs_errno (struct vfs_class *me)
 {
     return my_errno;
 }
@@ -630,7 +630,7 @@ typedef struct {
 } opendir_info;
 
 static void *
-mcfs_opendir (vfs *me, char *dirname)
+mcfs_opendir (struct vfs_class *me, char *dirname)
 {
     opendir_info *mcfs_info;
     mcfs_connection *mc;
@@ -876,13 +876,13 @@ mcfs_stat_cmd (int cmd, char *path, struct stat *buf)
 }
 
 static int
-mcfs_stat (vfs *me, char *path, struct stat *buf)
+mcfs_stat (struct vfs_class *me, char *path, struct stat *buf)
 {
     return mcfs_stat_cmd (MC_STAT, path, buf);
 }
 
 static int
-mcfs_lstat (vfs *me, char *path, struct stat *buf)
+mcfs_lstat (struct vfs_class *me, char *path, struct stat *buf)
 {
     int path_len = strlen (path);
     int entry_len = strlen (mcfs_readdir_data.dent.d_name);
@@ -920,19 +920,19 @@ mcfs_fstat (void *data, struct stat *buf)
 }
 
 static int
-mcfs_chmod (vfs *me, char *path, int mode)
+mcfs_chmod (struct vfs_class *me, char *path, int mode)
 {
     return mcfs_rpc_path_int (MC_CHMOD, path, mode);
 }
 
 static int
-mcfs_chown (vfs *me, char *path, int owner, int group)
+mcfs_chown (struct vfs_class *me, char *path, int owner, int group)
 {
     return mcfs_rpc_path_int_int (MC_CHOWN, path, owner, group);
 }
 
 static int
-mcfs_utime (vfs *me, char *path, struct utimbuf *times)
+mcfs_utime (struct vfs_class *me, char *path, struct utimbuf *times)
 {
     mcfs_connection *mc;
     int status;
@@ -964,7 +964,7 @@ mcfs_utime (vfs *me, char *path, struct utimbuf *times)
 }
 
 static int
-mcfs_readlink (vfs *me, char *path, char *buf, int size)
+mcfs_readlink (struct vfs_class *me, char *path, char *buf, int size)
 {
     char *remote_file, *stat_str;
     int status, error;
@@ -994,25 +994,25 @@ mcfs_readlink (vfs *me, char *path, char *buf, int size)
 }
 
 static int
-mcfs_unlink (vfs *me, char *path)
+mcfs_unlink (struct vfs_class *me, char *path)
 {
     return mcfs_rpc_path (MC_UNLINK, path);
 }
 
 static int
-mcfs_symlink (vfs *me, char *n1, char *n2)
+mcfs_symlink (struct vfs_class *me, char *n1, char *n2)
 {
     return mcfs_rpc_two_paths (MC_SYMLINK, n1, n2);
 }
 
 static int
-mcfs_rename (vfs *me, char *a, char *b)
+mcfs_rename (struct vfs_class *me, char *a, char *b)
 {
     return mcfs_rpc_two_paths (MC_RENAME, a, b);
 }
 
 static int
-mcfs_chdir (vfs *me, char *path)
+mcfs_chdir (struct vfs_class *me, char *path)
 {
     char *remote_dir;
     mcfs_connection *mc;
@@ -1049,25 +1049,25 @@ mcfs_lseek (void *data, off_t offset, int whence)
 }
 
 static int
-mcfs_mknod (vfs *me, char *path, int mode, int dev)
+mcfs_mknod (struct vfs_class *me, char *path, int mode, int dev)
 {
     return mcfs_rpc_path_int_int (MC_MKNOD, path, mode, dev);
 }
 
 static int
-mcfs_mkdir (vfs *me, char *path, mode_t mode)
+mcfs_mkdir (struct vfs_class *me, char *path, mode_t mode)
 {
     return mcfs_rpc_path_int (MC_MKDIR, path, mode);
 }
 
 static int
-mcfs_rmdir (vfs *me, char *path)
+mcfs_rmdir (struct vfs_class *me, char *path)
 {
     return mcfs_rpc_path (MC_RMDIR, path);
 }
 
 static int
-mcfs_link (vfs *me, char *p1, char *p2)
+mcfs_link (struct vfs_class *me, char *p1, char *p2)
 {
     return mcfs_rpc_two_paths (MC_LINK, p1, p2);
 }
@@ -1076,7 +1076,7 @@ mcfs_link (vfs *me, char *p1, char *p2)
  * out of them
  */
 static vfsid
-mcfs_getid (vfs *me, char *p, struct vfs_stamping **parent)
+mcfs_getid (struct vfs_class *me, const char *p, struct vfs_stamping **parent)
 {
     *parent = NULL;
 
@@ -1141,7 +1141,7 @@ my_forget (char *path)
 }
 
 static int
-mcfs_setctl (vfs *me, char *path, int ctlop, char *arg)
+mcfs_setctl (struct vfs_class *me, char *path, int ctlop, char *arg)
 {
     switch (ctlop) {
     case MCCTL_FORGET_ABOUT:
@@ -1151,7 +1151,7 @@ mcfs_setctl (vfs *me, char *path, int ctlop, char *arg)
     return 0;
 }
 
-vfs vfs_mcfs_ops = {
+struct vfs_class vfs_mcfs_ops = {
     NULL,			/* This is place of next pointer */
     "mcfs",
     0,				/* flags */

+ 18 - 18
vfs/sfs.c

@@ -47,7 +47,7 @@ static int uptodate (char *name, char *cache)
     return 1;
 }
 
-static int vfmake (vfs *me, char *name, char *cache)
+static int vfmake (struct vfs_class *me, char *name, char *cache)
 {
     char *inpath, *op;
     int w;
@@ -104,7 +104,7 @@ static int vfmake (vfs *me, char *name, char *cache)
 }
 
 static char *
-redirect (vfs *me, char *name)
+redirect (struct vfs_class *me, char *name)
 {
     struct cachedfile *cur = head;
     char *cache;
@@ -147,7 +147,7 @@ redirect (vfs *me, char *name)
 }
 
 static void *
-sfs_open (vfs *me, char *path, int flags, int mode)
+sfs_open (struct vfs_class *me, char *path, int flags, int mode)
 {
     int *sfs_info;
     int fd;
@@ -163,13 +163,13 @@ sfs_open (vfs *me, char *path, int flags, int mode)
     return sfs_info;
 }
 
-static int sfs_stat (vfs *me, char *path, struct stat *buf)
+static int sfs_stat (struct vfs_class *me, char *path, struct stat *buf)
 {
     path = redirect (me, path);
     return stat (path, buf);
 }
 
-static int sfs_lstat (vfs *me, char *path, struct stat *buf)
+static int sfs_lstat (struct vfs_class *me, char *path, struct stat *buf)
 {
     path = redirect (me, path);
 #ifndef HAVE_STATLSTAT
@@ -179,34 +179,34 @@ static int sfs_lstat (vfs *me, char *path, struct stat *buf)
 #endif
 }
 
-static int sfs_chmod (vfs *me, char *path, int mode)
+static int sfs_chmod (struct vfs_class *me, char *path, int mode)
 {
     path = redirect (me, path);
     return chmod (path, mode);
 }
 
-static int sfs_chown (vfs *me, char *path, int owner, int group)
+static int sfs_chown (struct vfs_class *me, char *path, int owner, int group)
 {
     path = redirect (me, path);
     return chown (path, owner, group);
 }
 
-static int sfs_utime (vfs *me, char *path, struct utimbuf *times)
+static int sfs_utime (struct vfs_class *me, char *path, struct utimbuf *times)
 {
     path = redirect (me, path);
     return utime (path, times);
 }
 
-static int sfs_readlink (vfs *me, char *path, char *buf, int size)
+static int sfs_readlink (struct vfs_class *me, char *path, char *buf, int size)
 {
     path = redirect (me, path);
     return readlink (path, buf, size);
 }
 
 static vfsid
-sfs_getid (vfs *me, const char *path, struct vfs_stamping **parent)
+sfs_getid (struct vfs_class *me, const char *path, struct vfs_stamping **parent)
 {				/* FIXME: what should I do? */
-    vfs *v;
+    struct vfs_class *v;
     vfsid id;
     struct vfs_stamping *par;
     struct cachedfile *cur = head;
@@ -266,7 +266,7 @@ static void sfs_free (vfsid id)
     g_free (cur);
 }
 
-static void sfs_fill_names (vfs *me, void (*func)(char *))
+static void sfs_fill_names (struct vfs_class *me, void (*func)(char *))
 {
     struct cachedfile *cur = head;
 
@@ -283,19 +283,19 @@ static int sfs_nothingisopen (vfsid id)
     return 1;
 }
 
-static char *sfs_getlocalcopy (vfs *me, char *path)
+static char *sfs_getlocalcopy (struct vfs_class *me, char *path)
 {
     path = redirect (me, path);
     return g_strdup (path);
 }
 
-static int sfs_ungetlocalcopy (vfs *me, char *path, char *local, int has_changed)
+static int sfs_ungetlocalcopy (struct vfs_class *me, char *path, char *local, int has_changed)
 {
     g_free(local);
     return 0;
 }
 
-static int sfs_init (vfs *me)
+static int sfs_init (struct vfs_class *me)
 {
     char *mc_sfsini;
     FILE *cfg;
@@ -364,7 +364,7 @@ static int sfs_init (vfs *me)
 }
 
 static void
-sfs_done (vfs *me)
+sfs_done (struct vfs_class *me)
 {
     int i;
 
@@ -377,7 +377,7 @@ sfs_done (vfs *me)
 }
 
 static int
-sfs_which (vfs *me, char *path)
+sfs_which (struct vfs_class *me, char *path)
 {
     int i;
 
@@ -392,7 +392,7 @@ sfs_which (vfs *me, char *path)
     return -1;
 }
 
-vfs vfs_sfs_ops = {
+struct vfs_class vfs_sfs_ops = {
     NULL,	/* This is place of next pointer */
     "sfs",
     0,		/* flags */

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