4 * Thomas Leonard, <tal197@users.sourceforge.net>
11 #include <sys/types.h>
15 DIR_START_SCAN
, /* Set 'scanning' indicator */
16 DIR_END_SCAN
, /* Clear 'scanning' indicator */
17 DIR_ADD
, /* Add the listed items to the display */
18 DIR_REMOVE
, /* Remove listed items from display */
19 DIR_UPDATE
, /* Redraw these items */
22 typedef struct _DirUser DirUser
;
23 typedef void (*DirCallback
)(Directory
*dir
,
28 extern GFSCache
*dir_cache
;
38 char *pathname
; /* Internal use only */
40 GList
*users
; /* Functions to call on update */
41 char *error
; /* NULL => no error */
43 gboolean notify_active
; /* Notify timeout is running */
44 gint idle_callback
; /* Idle callback ID */
46 GHashTable
*known_items
; /* What our users know about */
47 GPtrArray
*new_items
; /* New items to add in */
48 GPtrArray
*up_items
; /* Items to redraw */
49 GPtrArray
*gone_items
; /* Items removed */
51 GList
*recheck_list
; /* Items to check on callback */
53 gboolean have_scanned
; /* TRUE after first complete scan */
54 gboolean scanning
; /* TRUE if we sent DIR_START_SCAN */
56 /* Indicates that the directory needs to be rescanned.
57 * This is cleared when scanning starts, and set when the fscache
58 * detects that the directory needs to be rescanned and is already
61 * If scanning finishes when this is set, or if someone attaches
62 * and scanning is not in progress, a rescan is triggered.
64 gboolean needs_update
;
68 void dir_attach(Directory
*dir
, DirCallback callback
, gpointer data
);
69 void dir_detach(Directory
*dir
, DirCallback callback
, gpointer data
);
70 void dir_update(Directory
*dir
, gchar
*pathname
);
71 int dir_item_cmp(const void *a
, const void *b
);
72 void refresh_dirs(const char *path
);
73 void dir_check_this(const guchar
*path
);
74 DirItem
*dir_update_item(Directory
*dir
, const gchar
*leafname
);
75 void dir_rescan(Directory
*dir
, const guchar
*pathname
);
76 void dir_merge_new(Directory
*dir
);
77 void dir_force_update_path(const gchar
*path
);