mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
* vfs.h: Remove all references to seekdir and telldir. Adjust
all dependencies.
This commit is contained in:
parent
4b5acf720e
commit
426c1836d5
@ -1,3 +1,8 @@
|
||||
2003-10-14 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* vfs.h: Remove all references to seekdir and telldir. Adjust
|
||||
all dependencies.
|
||||
|
||||
2003-10-13 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* vfs.c (_vfs_add_noncurrent_stamps): Fix incorrect casts.
|
||||
|
@ -627,33 +627,6 @@ vfs_s_readdir(void *data)
|
||||
return (void *) &dir;
|
||||
}
|
||||
|
||||
static int
|
||||
vfs_s_telldir (void *data)
|
||||
{
|
||||
struct dirhandle *info = (struct dirhandle *) data;
|
||||
struct vfs_s_entry *cur;
|
||||
int num = 0;
|
||||
|
||||
cur = info->dir->subdir;
|
||||
while (cur!=NULL){
|
||||
if (cur == info->cur)
|
||||
return num;
|
||||
num++;
|
||||
cur = cur->next;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
vfs_s_seekdir (void *data, int offset)
|
||||
{
|
||||
struct dirhandle *info = (struct dirhandle *) data;
|
||||
int i;
|
||||
info->cur = info->dir->subdir;
|
||||
for (i=0; i<offset; i++)
|
||||
vfs_s_readdir (data);
|
||||
}
|
||||
|
||||
static int
|
||||
vfs_s_closedir (void *data)
|
||||
{
|
||||
@ -1095,8 +1068,6 @@ vfs_s_init_class (struct vfs_class *vclass)
|
||||
vclass->opendir = vfs_s_opendir;
|
||||
vclass->readdir = vfs_s_readdir;
|
||||
vclass->closedir = vfs_s_closedir;
|
||||
vclass->telldir = vfs_s_telldir;
|
||||
vclass->seekdir = vfs_s_seekdir;
|
||||
vclass->stat = vfs_s_stat;
|
||||
vclass->lstat = vfs_s_lstat;
|
||||
vclass->fstat = vfs_s_fstat;
|
||||
|
26
vfs/extfs.c
26
vfs/extfs.c
@ -909,30 +909,6 @@ static void * s_readdir(void *data)
|
||||
return (void *) &dir;
|
||||
}
|
||||
|
||||
static int s_telldir (void *data)
|
||||
{
|
||||
struct entry **info = (struct entry **) data;
|
||||
struct entry *cur;
|
||||
int num = 0;
|
||||
|
||||
cur = info[1];
|
||||
while (cur!=NULL) {
|
||||
if (cur == info[0]) return num;
|
||||
num++;
|
||||
cur = cur->next_in_dir;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void s_seekdir (void *data, int offset)
|
||||
{
|
||||
struct entry **info = (struct entry **) data;
|
||||
int i;
|
||||
info[0] = info[1];
|
||||
for (i=0; i<offset; i++)
|
||||
s_readdir( data );
|
||||
}
|
||||
|
||||
static int s_closedir (void *data)
|
||||
{
|
||||
g_free (data);
|
||||
@ -1393,8 +1369,6 @@ init_extfs (void)
|
||||
vfs_extfs_ops.opendir = s_opendir;
|
||||
vfs_extfs_ops.readdir = s_readdir;
|
||||
vfs_extfs_ops.closedir = s_closedir;
|
||||
vfs_extfs_ops.telldir = s_telldir;
|
||||
vfs_extfs_ops.seekdir = s_seekdir;
|
||||
vfs_extfs_ops.stat = s_stat;
|
||||
vfs_extfs_ops.lstat = s_lstat;
|
||||
vfs_extfs_ops.fstat = s_fstat;
|
||||
|
25
vfs/local.c
25
vfs/local.c
@ -89,29 +89,6 @@ local_opendir (struct vfs_class *me, char *dirname)
|
||||
return local_info;
|
||||
}
|
||||
|
||||
static int
|
||||
local_telldir (void *data)
|
||||
{
|
||||
#ifdef HAVE_TELLDIR
|
||||
return telldir( *(DIR **) data );
|
||||
#else
|
||||
#warning "Native telldir() not available, emulation not implemented"
|
||||
abort();
|
||||
return 0; /* for dumb compilers */
|
||||
#endif /* !HAVE_TELLDIR */
|
||||
}
|
||||
|
||||
static void
|
||||
local_seekdir (void *data, int offset)
|
||||
{
|
||||
#ifdef HAVE_SEEKDIR
|
||||
seekdir( *(DIR **) data, offset );
|
||||
#else
|
||||
#warning "Native seekdir() not available, emulation not implemented"
|
||||
abort();
|
||||
#endif /* !HAVE_SEEKDIR */
|
||||
}
|
||||
|
||||
static void *
|
||||
local_readdir (void *data)
|
||||
{
|
||||
@ -318,8 +295,6 @@ init_localfs (void)
|
||||
vfs_local_ops.opendir = local_opendir;
|
||||
vfs_local_ops.readdir = local_readdir;
|
||||
vfs_local_ops.closedir = local_closedir;
|
||||
vfs_local_ops.telldir = local_telldir;
|
||||
vfs_local_ops.seekdir = local_seekdir;
|
||||
vfs_local_ops.stat = local_stat;
|
||||
vfs_local_ops.lstat = local_lstat;
|
||||
vfs_local_ops.fstat = local_fstat;
|
||||
|
19
vfs/vfs.c
19
vfs/vfs.c
@ -505,24 +505,6 @@ mc_opendir (char *dirname)
|
||||
return (DIR *) handlep;
|
||||
}
|
||||
|
||||
void
|
||||
mc_seekdir (DIR *dirp, int offset)
|
||||
{
|
||||
int handle;
|
||||
struct vfs_class *vfs;
|
||||
|
||||
if (!dirp){
|
||||
errno = EFAULT;
|
||||
return;
|
||||
}
|
||||
handle = *(int *) dirp;
|
||||
vfs = vfs_op (handle);
|
||||
if (vfs->seekdir)
|
||||
(*vfs->seekdir) (vfs_info (handle), offset);
|
||||
else
|
||||
errno = E_NOTSUPP;
|
||||
}
|
||||
|
||||
#define MC_DIROP(name, type, onerr ) \
|
||||
type mc_##name (DIR *dirp) \
|
||||
{ \
|
||||
@ -543,7 +525,6 @@ type mc_##name (DIR *dirp) \
|
||||
}
|
||||
|
||||
MC_DIROP (readdir, struct dirent *, NULL)
|
||||
MC_DIROP (telldir, int, -1)
|
||||
|
||||
int
|
||||
mc_closedir (DIR *dirp)
|
||||
|
@ -42,8 +42,6 @@ struct vfs_class {
|
||||
void *(*opendir) (struct vfs_class *me, char *dirname);
|
||||
void *(*readdir) (void *vfs_info);
|
||||
int (*closedir) (void *vfs_info);
|
||||
int (*telldir) (void *vfs_info);
|
||||
void (*seekdir) (void *vfs_info, int offset);
|
||||
|
||||
int (*stat) (struct vfs_class *me, char *path, struct stat * buf);
|
||||
int (*lstat) (struct vfs_class *me, char *path, struct stat * buf);
|
||||
@ -163,8 +161,6 @@ int mc_chdir (char *);
|
||||
DIR *mc_opendir (char *dirname);
|
||||
struct dirent *mc_readdir (DIR * dirp);
|
||||
int mc_closedir (DIR * dir);
|
||||
int mc_telldir (DIR * dir);
|
||||
void mc_seekdir (DIR * dir, int offset);
|
||||
|
||||
int mc_stat (const char *path, struct stat *buf);
|
||||
int mc_lstat (const char *path, struct stat *buf);
|
||||
|
Loading…
Reference in New Issue
Block a user