summaryrefslogtreecommitdiff
path: root/common/filelist-vfs-intf.h
blob: ff3eeef0d436b8321c19a5583ab2ccfe1aeda0e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*  Tux Commander VFS: convenient interface for VFS modules to a filelist tree
 *  Copyright (C) 2007-2009 Tomas Bzatek <tbzatek@users.sourceforge.net>
 *   Check for updates on tuxcmd.sourceforge.net
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __TREEPATH_VFS_H__
#define __TREEPATH_VFS_H__

#ifdef __cplusplus
  extern "C" {
#endif


#include <glib.h>

#include "tuxcmd-vfs.h"
#include "filelist.h"


struct VfsFilelistData {
  struct PathTree *files;

  long int         list_dir_index;
  struct PathTree *list_dir_node;
  char *           list_dir_path;

  gboolean         follow_symlinks;
  gboolean         add_full_path;

  gboolean         break_get_dir_size;
};


struct VfsFilelistData *  vfs_filelist_new (struct PathTree *files);
void         vfs_filelist_free (struct VfsFilelistData *data);

guint64      vfs_filelist_get_dir_size (struct VfsFilelistData *data, const char *APath);
void         vfs_filelist_get_dir_size_break (struct VfsFilelistData *data);

gboolean     vfs_filelist_file_exists (struct VfsFilelistData *data, const char *FileName, const long Use_lstat);
TVFSResult   vfs_filelist_file_info   (struct VfsFilelistData *data, const char *AFileName, struct TVFSItem *Item, gboolean FollowSymlinks, gboolean AddFullPath);

TVFSResult   vfs_filelist_list_first (struct VfsFilelistData *data, const char *sDir, struct TVFSItem *Item, gboolean FollowSymlinks, gboolean AddFullPath);
TVFSResult   vfs_filelist_list_next  (struct VfsFilelistData *data, struct TVFSItem *Item);
TVFSResult   vfs_filelist_list_close (struct VfsFilelistData *data);

char *       vfs_filelist_change_dir (struct VfsFilelistData *data, const char *NewPath);



#ifdef __cplusplus
  }
#endif
#endif /* __TREEPATH_VFS_H__ */