Commit Graph

56 Commits

Author SHA1 Message Date
Mikhail S. Pobolovets
0a7899709b Simple doxygen description for files in vfs (not subdirs) directory.
Mostly \file and \brief tag added.

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-02-10 16:18:55 +02:00
Leonard den Ottolander
a03c48ffa4 fish.c, xdirentry.h: Fix 2 GB file size limit for fish. 2006-01-27 22:16:45 +00:00
Pavel Tsekov
c8494f41bb * xdirentry.h (LS_LINEAR_PREOPEN): New macro definition.
* direntry.c (vfs_s_open): When opening a file in linear mode,
defer the actual open operation until the first read call.
(vfs_s_read): When reading in linear mode, open the file
on the first read operation.
(vfs_s_lseek): When in linear mode, make sure that seeking is
allowed only before the first read operation.
* ftpfs.c (ftpfs_ctl): Make the code aware of LS_LINEAR_PREOPEN.
* fish.c (fish_ctl): Likewise.
2006-01-25 14:04:27 +00:00
Roland Illig
7e7b81b73e * direntry.c: Added const qualifiers to work around gcc
warnings.
	* extfs.c: Likewise.
	* fish.c: Likewise.
	* ftpfs.c: Likewise.
	* sfs.c: Likewise.
	* xdirentry.h: Likewise.
2005-09-05 00:52:56 +00:00
Roland Illig
2a57a2e1e3 * xdirentry.h: Added missing #include directives. 2005-07-03 22:55:55 +00:00
Roland Illig
9997fa69f8 * *.h: Renamed the multiple inclusion guards. 2005-02-18 21:15:37 +00:00
Andrew V. Samoilov
687f435740 * xdirentry.h (linear_start): Use off_t for offset. 2004-10-06 18:04:15 +00:00
Roland Illig
a3cf3b2d5f * direntry.c (vfs_s_new_entry): see 2004-09-19. Additionally followed the advice
concerning g_strdup in /HACKING.
	(vfs_s_generate_entry): Likewise.
	(vfs_s_find_entry_linear): Likewise.
	(vfs_s_find_inode): Likewise.
	* xdirentry.h: Likewise.
2004-09-22 11:28:14 +00:00
Andrew V. Samoilov
c524515308 * direnty.c (vfs_s_new_entry): Revert last changes.
(vfs_s_generate_entry): Likewise.
        (vfs_s_find_entry_linear): Likewise.
        (vfs_s_find_inode): Likewise.
        * xdirentry.h: likewise.
2004-09-22 05:50:45 +00:00
Roland Illig
a9f9db7b6b * direntry.c: Added const qualifier to function declarations and
variables. Introduced local modifiable strings where necessary.
	* xdirentry.h: likewise.
2004-09-19 16:07:17 +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
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
bc455d5840 * direntry.c (vfs_s_find_inode): Only allow search from root.
Change second argument to superblock to prevent abuse.
2003-10-27 03:09:40 +00:00
Pavel Roskin
511321bcfd * direntry.c (vfs_s_add_dots): Remove. Fix all callers.
(vfs_s_free_inode): Remove support for "." and ".." entries.
* ftpfs.c (dir_load): Likewise.
Support for "." and ".." entries was a hack that could make the
cache non-traversible from inodes to the root and cause infinite
loop in vfs_s_fullpath().
Reported by Frdric L. W. Meunier <lists1@pervalidus.net>
2003-10-27 01:26:18 +00:00
Pavel Roskin
2c458dcc52 Don't include vfs.h. 2003-10-26 03:40:23 +00:00
Pavel Roskin
be3fa535ba * ftpfs.c: Remove the rest of source routing code.
* xdirentry.h: Likewise.
2003-10-24 20:08:38 +00:00
Pavel Roskin
7c4fc715da * direntry.c (vfs_s_setctl): Implement VFS_SETCTL_FLUSH.
* ftpfs.c: Remove ftpfs_flushdir.  Use MEDATA->flush.
* fish.c: Use MEDATA->flush.
2003-10-16 18:51:41 +00:00
Pavel Roskin
63740624ea * xdirentry.h: Rename vfs_s_data to vfs_s_subclass.
* cpio.c: Initialize only non-zero fields in vfs_s_subclass.
* fish.c: Likewise.
* ftpfs.c: Likewise.
* tar.c: Likewise.
2003-10-16 16:40:11 +00:00
Pavel Roskin
fc7267906f * xdirentry.h: Move system includes to the files that need them. 2003-10-16 08:47:33 +00:00
Pavel Roskin
1504215498 More comment fixes. 2003-10-16 08:00:05 +00:00
Pavel Roskin
a8a471a282 Comment changes. 2003-10-16 06:50:05 +00:00
Pavel Roskin
dcd2b9e8fc * xdirentry.h: Fix typos in field names. 2003-10-16 06:05:39 +00:00
Pavel Roskin
a6754ce841 * xdirentry.h: Cleanup unused or write-only fields. Adjust all
dependencies.
2003-10-16 05:47:23 +00:00
Pavel Roskin
b7efdfa380 * xdirentry.h: Remove magic numbers. Move some constants ...
* ftpfs.c: ... here.
2003-10-16 05:06:24 +00:00
Pavel Roskin
6cf97f4069 * xdirentry.h: Remove all typedefs, there is no need to hide the
fact that structures are structures.  Fix all dependencies.
2003-10-12 01:00:44 +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
523589cddc * direntry.c: Make more functions static. They are filled in in
vfs_s_init_class() now and don't need to be exported.
2003-10-11 10:13:36 +00:00
Pavel Roskin
091023c37a * undelfs.c (undelfs_get_path): Constify first argument.
* vfs.h (struct vfs_class): Constify path.  Fix all dependencies.
2003-10-11 07:20:53 +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
b1aba35e22 * direntry.c: Make functions static when possible.
* xdirentry.h: Remove unneeded declarations.
2003-10-07 22:38:28 +00:00
Pavel Roskin
ef9371e3fa * ftpfs.c (initconn): Use more portable initialization.
* xdirentry.h: Use safer definition of ERRNOR.
2003-08-29 22:32:21 +00:00
Andrew V. Samoilov
07f3c2f7af * xdirentry.h: Comment out magic field everywhere. 2002-10-01 17:03:55 +00:00
Pavel Roskin
da7e82d253 Global removal of RCS Id: flags. 2002-09-26 23:13:45 +00:00
Pavel Roskin
966511399b Move fcntl.h inclusion to global.h. 2002-09-23 06:45:32 +00:00
Andrew V. Samoilov
6bd685bd7c * xdirentry.h (vfs_s_fh.u.fish): Add append field.
* fish.c (fish_fh_open): Care about append.
(linear_open): Likewise.
(fish_store): Append data to target file if append is true.
2002-07-26 01:33:40 +00:00
Pavel Roskin
2be225d9e0 * ftpfs.c: Don't use SUP.home, use SUP.cwdir.
* fish.c: Likewise.
(dir_load): Update SUP.cwdir.
* xdirentry.h: Remove "home" field for fish and ftpfs.
2002-07-19 16:36:32 +00:00
Pavel Roskin
982a256ee0 * xdirentry.h: Get rid of ifree(), it's equivalent to g_free().
* direntry.c: Likewise.
* fish.c: Likewise.
* ftpfs.c: Likewise.
2002-07-19 16:04:27 +00:00
Pavel Roskin
4f52b831df * xdirentry.h: Eliminate use_proxy field.
* ftpfs.c (open_archive_int): Use SUP.proxy instead of
SUP.use_proxy.
(open_archive): Set SUP.proxy to ftpfs_proxy_host.
* ftpfs.h: Eliminate unused structures.
2002-07-12 00:05:11 +00:00
Andrew V. Samoilov
a60f38583a * xdirentry.h (vfs_s_fh.u.ftp): Add append field.
(vfs_s_data.file_store): Change second argument
to (vfs_s_fh *fh).
* direntry.c (vfs_s_close): Adjust.
* fish.c (file_store): Likewise.
* ftpfs.c (file_store): Likewise.  Use "APPE" if
fh->u.ftp.append is true.
(linear_start): Care about fh->u.ftp.append.
(ftpfs_fh_open): Likewise.
2002-05-22 17:19:24 +00:00
Andrew V. Samoilov
09bad78c80 * xdirentry.h (vfs_s_super): Add control_connection_buzy
field to ftp struct.

	* ftpfs.c (linear_start): Set control_connection_buzy.
	(linear_abort): Unset control_connection_buzy.
	(ftpfs_fh_open): Don't retrieve file if it is
	opened for writting only.  Open data connection as
	fh->handle and unlink/unset local temporary file
	if control connection isn't buzy.
	(ftpfs_fh_close): New function to serve opened in
	ftpfs_fh_open() data connection.  Unset fh->changed
	to prevent MEDATA->file_store() call from vfs_s_close().
2002-05-17 13:32:02 +00:00
Andrew V. Samoilov
480dc4765f * xdirentry.h (struct vfs_s_super): Remove u.ftp.result_pending field.
* ftpfs.h (struct connection): Remove result_pending field.
2001-08-03 10:15:17 +00:00
Pavel Roskin
680f3f7ed2 * cpio.c: Include <config.h> before everything else.
* direntry.c: Likewise.
* fish.c: Likewise.
* ftpfs.c: Likewise.
* local.c: Likewise.
* tar.c: Likewise.
* utilvfs.h: Don't include <config.h> - it should be included
in all C files instead.
* xdirentry.h: Likewise.
2001-06-25 21:34:46 +00:00
Pavel Roskin
bea09b932d * src/ext.c (exec_extension): Use mc_mkstemps().
* src/user.c (execute_menu_command): Use mc_mkstemps().
* src/util.c (mc_mkstemps): New function - safely create and
open temporary file. Return the handle and the name.
* src/util.h: Declarations for init_tmpdir() and mc_mkstemps().
Define TMPDIR_DEFAULT and SCRIPT_SUFFIX.
* vfs/direntry.c (vfs_s_open): Use mc_mkstemps. Create and close
temporary file to reserve its name on the filesystem.
(vfs_s_retrieve_file): Use mc_mkstemps().
(g_tempnam): Remove.
* vfs/extfs.c (extfs_open): Use mc_mkstemps().
* vfs/sfs.c (redirect): Likewise.
* vfs/shared_ftp_fish.c (_get_file_entry): Likewise.
(retrieve_file): Likewise.
* vfs/vfs.c (mc_def_getlocalcopy): Likewise.
* vfs/xdirentry.h: Remove declaration of g_tempnam().
2001-05-21 16:21:07 +00:00
Pavel Machek
55e56a1426 Fixes from Roland: we may not g_free() strdup-ed text. 2000-10-31 15:43:49 +00:00
Pavel Machek
0b25d26cf0 2000-02-25 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
Patch by  Andrew V. Samoilov <sav@bcs.zp.ua>

        * vfs.[ch] (vfs_canon, mc_open, vfs_file_is_local,
          mc_(un)?getlocalcopy): added const qualifier
        (mc_def_getlocalcopy): tempnam() returns malloc()ed buffer,
          so, free() it, not g_free();
        (vfs_canon): prepend filename by cwd when tilde '~' cannot be expanded;
2000-02-25 12:53:06 +00:00
Pavel Machek
5d240399be 2000-02-22 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
* cpio.c: added. Thanx to Jan Hudec <bulb@centrum.cz>, who wrote
        it using code from tarfs.
2000-02-22 18:21:41 +00:00
Pavel Machek
06542c693a Added missing prototype. 2000-02-02 16:59:19 +00:00
Pavel Machek
1139602a9b Return value is needed for mc_[un]getlocalcopy. 1999-11-11 14:23:40 +00:00
Timur Bakeyev
bf81009392 Actually commit all my changers. Fear :> 1999-01-20 22:01:11 +00:00