1
2
3
4
5
6
7 #ifndef MC__TREE_STORE_H
8 #define MC__TREE_STORE_H
9
10
11
12
13
14
15 struct tree_entry;
16 typedef void (*tree_store_remove_fn) (struct tree_entry *tree, void *data);
17
18
19
20
21
22 typedef struct tree_entry
23 {
24 vfs_path_t *name;
25 int sublevel;
26 long submask;
27 const char *subname;
28 gboolean mark;
29 gboolean scanned;
30 struct tree_entry *next;
31 struct tree_entry *prev;
32 } tree_entry;
33
34 struct TreeStore
35 {
36 tree_entry *tree_first;
37 tree_entry *tree_last;
38 tree_entry *check_start;
39 vfs_path_t *check_name;
40 GList *add_queue_vpath;
41 gboolean loaded;
42 gboolean dirty;
43 };
44
45
46
47
48
49 struct TreeStore *tree_store_get (void);
50 int tree_store_load (void);
51 int tree_store_save (void);
52 void tree_store_remove_entry (const vfs_path_t *name_vpath);
53 tree_entry *tree_store_start_check (const vfs_path_t *vpath);
54 void tree_store_mark_checked (const char *subname);
55 void tree_store_end_check (void);
56 tree_entry *tree_store_whereis (const vfs_path_t *name);
57 tree_entry *tree_store_rescan (const vfs_path_t *vpath);
58
59 void tree_store_add_entry_remove_hook (tree_store_remove_fn callback, void *data);
60 void tree_store_remove_entry_remove_hook (tree_store_remove_fn callback);
61
62
63 #endif