Commit Graph

157 Commits

Author SHA1 Message Date
Andrew V. Samoilov
2f7bbc2c31 * vfs.c (mc_def_ungetlocalcopy): Fix missed "%s".
* utilvfs.c (vfs_parse_ls_lga): Likewise.
2004-03-07 06:07:43 +00:00
Pavel Roskin
fc9bf6040f * gc.c (vfs_ncs_getid): Merge with vfs_getid(). 2003-11-26 21:25:30 +00:00
Pavel Roskin
6ffd35bf07 * gc.c: Eliminate all code for timestamping parent filesystems.
It's broken and undocumented.  Adjust all dependencies.
2003-11-26 21:10:42 +00:00
Pavel Roskin
a128188ae1 Warning fixes for FreeBSD 5.1. 2003-11-21 03:17:18 +00:00
Pavel Roskin
54b8c9aaad * vfs.c (vfs_split): Deconstify.
* direntry.c (vfs_s_get_path_mangle): Likewise.  "mangle" is in
the name for a reason.  Use vfs_s_get_path() instead where the
path should be preserved.
* extfs.c (extfs_get_path_mangle): Likewise.
* sfs.c (sfs_vfmake): Protect against changes in vfs_split().
2003-11-14 08:25:50 +00:00
Pavel Roskin
30c4bd1b6d * vfs.h: Constify chdir() and opendir() methods. Adjust all
dependencies.
* vfs.c (mc_chdir): Constify, eliminate protection against
broken implementations of chdir() method.
(mc_opendir): Constify.
2003-11-13 08:29:37 +00:00
Pavel Roskin
b33f2cbb47 * vfs.c: Split garbage collection code into ...
* gc.c: ... this.
* vfs.h: Corresponding code moved ...
* gc.h: ... here.
* Makefile.am: Adjustments for the above.
2003-11-07 23:43:55 +00:00
Pavel Roskin
106a90ae99 * vfs.c: Eliminate MC_OP. Reorder other MC_* macros for
readability.
2003-11-05 06:34:20 +00:00
Pavel Roskin
0318ed5d0b * vfs.c: Move all parsing code, vfs_die() and vfs_get_password()
to utilvfs.c, vfs_print_stats() to direntry.c.
* utilvfs.c (vfs_parse_ls_lga): Disable caching current date,
it's done incorrectly.
2003-11-05 06:08:16 +00:00
Pavel Roskin
c468c1b6e9 * vfs.c: Allocate handles dynamically.
(get_bucket): Rewrite as vfs_new_handle().
(vfs_op): Make a function.
(vfs_info): Likewise.
(vfs_free_bucket): Replace with vfs_free_handle().
(mc_readdir): Expand, eliminate MC_DIROP.
2003-11-05 00:12:25 +00:00
Pavel Roskin
24dd87b714 * vfs.c (vfs_rmstamp): Rescan the tree after the parents have
been removed.  Otherwise using old data causes data corruption
in some combinations (e.g. extfs inside tatfs).
2003-10-30 05:58:06 +00:00
Pavel Roskin
f2550b08ee * extfs.h: Merge ...
* extfs.c: ... here.
* Makefile.am: Remove extfs.h.
2003-10-29 23:05:27 +00:00
Pavel Roskin
0ba019a90b * configure.in: Use AC_CHECK_MEMBERS to check fields of struct
stat.  Adjust all dependencies.
2003-10-29 17:36:16 +00:00
Pavel Roskin
edce41facd * utilvfs.c (vfs_mkstemps): New function - create temporary file
with the name resembling the original, but safe for scripts.
* direntry.c (vfs_s_open): Use it.
(vfs_s_retrieve_file): Likewise.
* extfs.c (extfs_open): Likewise.
* sfs.c (sfs_redirect): Likewise.
2003-10-29 00:50:36 +00:00
Pavel Roskin
77bcdc8127 * vfs.c (mc_ungetlocalcopy): Free local path here, not in class
implementations.
* vfs.h (struct vfs_s_class): Constify "local" argument for
ungetlocalcopy.  Adjust all implementations.
2003-10-28 21:52:06 +00:00
Pavel Roskin
8e3a0c9d65 * direntry.c (vfs_s_init_class): Improve interface to allow more
code reuse.  Change all callers.
(vfs_s_getlocalcopy): New implementation.  Don't use
mc_def_getlocalcopy().  Use vfs_s_open() to create local copy.
(vfs_s_ungetlocalcopy): New function.
* xdirentry.h: Add new field "flags" to struct vfs_s_subclass.
* extfs.c (extfs_ungetlocalcopy): Don't use
mc_def_ungetlocalcopy() in the dead branch.
* vfs.c (mc_def_getlocalcopy): Make static.
(mc_def_ungetlocalcopy): Likewise.
2003-10-28 07:09:39 +00:00
Pavel Roskin
7d16d65e35 * vfs.h: Constify some arguments for many functions.
* xdirentry.h: Likewise.  Adjust all dependencies.
2003-10-28 02:10:33 +00:00
Pavel Roskin
5bc20fd294 * *.c: Rename functions that don't have an a prefix indicating
what file they are defined in.  This simplifies debugging.
2003-10-28 00:57:02 +00:00
Pavel Roskin
520f6ddb6c * vfs.c (mc_def_getlocalcopy): Use O_LINEAR when retrieving the
remote file.  This avoids an extra temporary file.
2003-10-27 21:55:06 +00:00
Pavel Roskin
4ee3f26133 * cpio.c (cpio_ungetlocalcopy): Remove.
* tar.c (tar_ungetlocalcopy): Likewise.
* vfs.c (mc_def_ungetlocalcopy): Add support for read-only
filesystems.
2003-10-27 21:01:00 +00:00
Pavel Roskin
24384e9a89 * panel.h: Fix duplication between cpanel and current_panel in
favor of current_panel.  Ditto opanel and other_panel.
2003-10-26 06:45:59 +00:00
Pavel Roskin
211ce16fac * wtools.c: Merge mc_message() and message() into one background
safe function message().  Fix all callers.
2003-10-26 04:47:20 +00:00
Pavel Roskin
2d33b5047e * background.c: Replace all message stubs with a new function
mc_message().  Protect against strlen(MSG_ERROR).  Adjust all
dependencies.
2003-10-25 19:54:24 +00:00
Pavel Roskin
3b2e731d3d * vfs.c (mc_open): Fix rare memory leak on failure. 2003-10-16 20:46:08 +00:00
Pavel Roskin
0b99804da2 * names.c: Merge ...
* utilvfs.c: ... here.
* names.h: Merge ...
* utilvfs.h: ... here.
* Makefile.am: Remove references to names.c and names.h.
2003-10-16 16:50:09 +00:00
Pavel Roskin
52844a3092 * vfs.h: Rename commands for mc_ctl() and mc_setctl() to make it
clear which function they are used with.
* vfs.c (mc_ctl): Change last argument to (void*).
(mc_set): Likewise.
Adjust all dependencies.
2003-10-16 16:12:19 +00:00
Pavel Roskin
426c1836d5 * vfs.h: Remove all references to seekdir and telldir. Adjust
all dependencies.
2003-10-14 22:24:26 +00:00
Pavel Roskin
600891d8d5 * vfs.c (_vfs_add_noncurrent_stamps): Fix incorrect casts. 2003-10-13 06:56:31 +00:00
Pavel Roskin
72c64a60e2 * extfs.c: Switch to self-registration.
* mcfs.c: Likewise.
* sfs.c: Likewise.
* smbfs.c: Likewise.
* undelfs.c: Likewise.
* vfs.s (_vfs_add_noncurrent_stamps): Temporary disable code
that uses vfs_extfs_ops.
(vfs_file_is_smb): Remove.
2003-10-12 22:25:53 +00:00
Pavel Roskin
2e524d3cad * local.c: Switch to self-registration.
* vfs.c: Cache localfs class for the use in vfs_get_class().
2003-10-12 19:57:27 +00:00
Pavel Roskin
00b57fd4bf * vfs.h: Remove typedef vfs, it's too ambiguous. Massive
changes to use struct vfs_class instead.
2003-10-12 00:24:00 +00:00
Pavel Roskin
4b1ec7399b * vfs.c (vfs_setup_wd): Initialize current_vfs here, not
globally.
(vfs_type_from_op): Rename to vfs_prefix_to_class(), avoid using
vfs_local_fs.
(vfs_strip_suffix_from_filename): Don't use vfs_local_fs.
2003-10-11 22:17:52 +00:00
Pavel Roskin
6e6fd9b352 * vfs.c (vfs_add_noncurrent_stamps): Call vfs_rm_parents() at
the end.  Change all callers not to call it.
(vfs_rm_parents): Make static.
2003-10-11 17:30:54 +00:00
Pavel Roskin
3fb8e46501 * direntry.c: Don't use vfs_local_fs directly, use VFSF_LOCAL.
* extfs.c: Likewise.
* vfs.c (vfs_addstamp): Likewise.
(vfs_init): Register vfs_local_fs like other classes.
2003-10-11 16:54:46 +00:00
Pavel Roskin
5cad1eb493 * tarfs.c: Switch to self-registration. 2003-10-11 09:55:13 +00:00
Pavel Roskin
b2486a2b71 * extfs.c: Don't include xdirentry.h.
* vfs.c: Likewise.
2003-10-11 09:36:29 +00:00
Pavel Roskin
c028805b33 * ftpfs.c: Switch to self-registration. 2003-10-11 09:27:37 +00:00
Pavel Roskin
1d6e00faf0 * vfs.h: Introduce new VFS flags instead of the old unused ones.
* vfs.c (vfs_file_class_flags): New function.
(vfs_file_is_ftp): Eliminate.
(vfs_file_is_smb): Likewise.
(vfs_file_is_local): Likewise.
(vfs_current_is_local): Use new VFSF_LOCAL flag.
2003-10-11 08:21:16 +00:00
Pavel Roskin
60bab59379 * vfs.c: Constify arguments of many functions. 2003-10-11 07:38:05 +00:00
Pavel Roskin
5659c0f5ee * vfs.c (vfs_release_path): New function, code taken from
_do_panel_cd().
(vfs_ncs_getid): Make static.
2003-10-11 06:43:59 +00:00
Pavel Roskin
9d1f2aae71 * vfs.c (vfs_type): Rename to vfs_get_class(). Fix prototype to
avoid using internal vfs type.  Adjust all dependencies.
(vfs_rosplit): Rename to _vfs_get_class().
2003-10-11 06:25:29 +00:00
Pavel Roskin
617bf6880a * vfs.c (vfs_flags): Eliminate, it's never assigned a non-zero
value.
* vfs.h: Eliminate unused VFS flags.
* local.c (vfs_nil_ops): Eliminate, it's unused now.
2003-10-10 23:49:44 +00:00
Pavel Roskin
413f8cbabd * 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().
2003-10-10 23:38:03 +00:00
Pavel Roskin
b2edfddd7e * 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.
(vfs_register): Rename to vfs_register_class(), remove "static".
* direntry.c (vfs_s_init_class): New function - generic VFS
class registraction for vfs_s descendants.
* cpio.c: Register VFS class locally.
2003-10-10 23:13:09 +00:00
Pavel Roskin
9ddf2306e5 * vfs.c (vfs_type_from_op): Check if vfs->prefix is NULL before
calling strlen() on it.
(vfs_strip_suffix_from_filename): Likewise.
(mc_chdir): Don't panic if no chdir function is defined.  This
fixes "cd #gz".
2003-09-28 20:35:08 +00:00
Pavel Roskin
525deb6fc7 * vfs.c (vfs_canon): Remove tilde expansion. mc_chdir() should
act like chdir() of localfs, which doesn't expand tilde.
Reported by Doncho Gunchev <mr700@globalnet.bg>
2003-09-23 05:18:50 +00:00
Pavel Roskin
cdd8f8ce86 * vfs.c (mc_get_current_wd): Use g_strlcpy() to avoid unneeded
padding and silence Valgrind.
2003-09-22 19:43:41 +00:00
Pavel Roskin
ab84c14503 * vfs.c: Rename mc_return_cwd() to _vfs_get_cwd(). Move
related functions closer to each other, add comments.
2003-06-06 00:50:22 +00:00
Pavel Roskin
6df9219f85 * extfs.c (extfs_open): Retain original filename as a suffix
for the temporary filename.
* vfs.c (mc_def_getlocalcopy): Likewise.
2003-02-26 17:43:18 +00:00
Andrew V. Samoilov
004ae18d9e * vfs.c (is_localized_month): New function for locale's
abbreviated month name as any 3 bytes long string without digits
and control characters.
(vfs_parse_filedate): Fallback to is_localized_month() if
is_month() and is_dos_date() fail and set date to Jan 1 1970.
(vfs_parse_ls_lga): Use is_localized_month().
2003-02-19 08:38:49 +00:00