From 5659c0f5eecda4197d825a561486e38b74965a64 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sat, 11 Oct 2003 06:43:59 +0000 Subject: [PATCH] * vfs.c (vfs_release_path): New function, code taken from _do_panel_cd(). (vfs_ncs_getid): Make static. --- vfs/ChangeLog | 4 ++++ vfs/vfs.c | 16 +++++++++++++++- vfs/vfs.h | 5 +++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index b591b0138..073de665f 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,9 @@ 2003-10-11 Pavel Roskin + * vfs.c (vfs_release_path): New function, code taken from + _do_panel_cd(). + (vfs_ncs_getid): Make static. + * 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(). diff --git a/vfs/vfs.c b/vfs/vfs.c index 2b3ce59e9..fe18919d6 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -745,7 +745,7 @@ vfs_canon (const char *path) } } -vfsid +static vfsid vfs_ncs_getid (vfs *nvfs, char *dir, struct vfs_stamping **par) { vfsid nvfsid; @@ -1872,3 +1872,17 @@ vfs_translate_url (char *url) else return g_strdup (url); } + + +void +vfs_release_path (char *dir) +{ + struct vfs_class *oldvfs; + vfsid oldvfsid; + struct vfs_stamping *parent; + + oldvfs = vfs_get_class (dir); + oldvfsid = vfs_ncs_getid (oldvfs, dir, &parent); + vfs_add_noncurrent_stamps (oldvfs, oldvfsid, parent); + vfs_rm_parents (parent); +} diff --git a/vfs/vfs.h b/vfs/vfs.h index 964d07e35..7bff54fad 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -64,7 +64,7 @@ struct vfs_class { int (*lseek) (void *vfs_info, off_t offset, int whence); int (*mknod) (vfs *me, char *path, int mode, int dev); - vfsid (*getid) (vfs *me, char *path, struct vfs_stamping ** parent); + vfsid (*getid) (vfs *me, char *path, struct vfs_stamping ** parent); int (*nothingisopen) (vfsid id); void (*free) (vfsid id); @@ -122,7 +122,6 @@ void vfs_shut (void); struct vfs_class *vfs_get_class (char *path); vfs *vfs_split (char *path, char **inpath, char **op); -vfsid vfs_ncs_getid (vfs *nvfs, char *dir, struct vfs_stamping **par); void vfs_rm_parents (struct vfs_stamping *stamp); char *vfs_path (char *path); char *vfs_strip_suffix_from_filename (const char *filename); @@ -143,6 +142,7 @@ void vfs_add_current_stamps (void); void vfs_timeout_handler (void); void vfs_expire (int); int vfs_timeouts (void); +void vfs_release_path (char *dir); void vfs_fill_names (void (*)(char *)); char *vfs_translate_url (char *); @@ -215,6 +215,7 @@ int mc_munmap (caddr_t addr, size_t len); #define vfs_current_is_extfs() 0 #define vfs_path(x) x #define vfs_strip_suffix_from_filename(x) g_strdup(x) +#define vfs_release_path(x) #define mc_close close #define mc_read read #define mc_write write