mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Couple of fixes to Pavel's VFS stuff.
I do think I am going to expand the VFS functions again, I do not like this macro stuff. Miguel.
This commit is contained in:
parent
37c46d866c
commit
9ee743dea5
@ -1,3 +1,7 @@
|
|||||||
|
1998-05-26 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* vfs.c (MC_DIROP): Macro now returns the proper value.
|
||||||
|
|
||||||
1998-maj-18 Tamasi Gyorgy (gt_cosy@usa.net)
|
1998-maj-18 Tamasi Gyorgy (gt_cosy@usa.net)
|
||||||
|
|
||||||
* Makefile.in ('install' target): 'mcserv' not installed, if
|
* Makefile.in ('install' target): 'mcserv' not installed, if
|
||||||
|
22
vfs/vfs.c
22
vfs/vfs.c
@ -412,15 +412,31 @@ type mc_##name inarg \
|
|||||||
\
|
\
|
||||||
if (!dirp){ \
|
if (!dirp){ \
|
||||||
errno = EFAULT; \
|
errno = EFAULT; \
|
||||||
return NULL; \
|
return onerr; \
|
||||||
} \
|
} \
|
||||||
handle = *(int *) dirp; \
|
handle = *(int *) dirp; \
|
||||||
vfs = vfs_op (handle); \
|
vfs = vfs_op (handle); \
|
||||||
return vfs->name ? (*vfs->name) callarg : onerr; \
|
return vfs->name ? (*vfs->name) callarg : onerr; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MC_DIROP_VOID(name, inarg, callarg ) \
|
||||||
|
void mc_##name inarg \
|
||||||
|
{ \
|
||||||
|
int handle; \
|
||||||
|
vfs *vfs; \
|
||||||
|
\
|
||||||
|
if (!dirp){ \
|
||||||
|
errno = EFAULT; \
|
||||||
|
return; \
|
||||||
|
} \
|
||||||
|
handle = *(int *) dirp; \
|
||||||
|
vfs = vfs_op (handle); \
|
||||||
|
if (vfs->name) \
|
||||||
|
(*vfs->name) callarg; \
|
||||||
|
}
|
||||||
|
|
||||||
MC_DIROP (readdir, struct dirent *, (DIR *dirp), (vfs_info (handle)), NULL)
|
MC_DIROP (readdir, struct dirent *, (DIR *dirp), (vfs_info (handle)), NULL)
|
||||||
MC_DIROP (seekdir, void, (DIR *dirp, int offset), (vfs_info (handle), offset), -1)
|
MC_DIROP_VOID (seekdir, (DIR *dirp, int offset), (vfs_info (handle), offset))
|
||||||
MC_DIROP (telldir, int, (DIR *dirp), (vfs_info (handle)), -1)
|
MC_DIROP (telldir, int, (DIR *dirp), (vfs_info (handle)), -1)
|
||||||
|
|
||||||
int mc_closedir (DIR *dirp)
|
int mc_closedir (DIR *dirp)
|
||||||
@ -1504,6 +1520,6 @@ vfs_die (char *m)
|
|||||||
char *
|
char *
|
||||||
vfs_get_password (char *msg)
|
vfs_get_password (char *msg)
|
||||||
{
|
{
|
||||||
return input_dialog (msg, _("Password:"), "");
|
return (char *) input_dialog (msg, _("Password:"), "");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user