Use FileData locks to avoid expensive reloads with marks enabled
[geeqie.git] / src / filedata.h
index 4050148..43edc42 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Geeqie
  * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
  *
  * Author: John Ellis
  *
 #define DEBUG_FILEDATA
 #endif
 
+#define FD_MAGICK 0x12345678u
+
 gchar *text_from_size(gint64 size);
 gchar *text_from_size_abrev(gint64 size);
 const gchar *text_from_time(time_t t);
 
-/* this expects a utf-8 path */
-FileData *file_data_new_simple(const gchar *path_utf8);
+/* scan for sidecar files - expensive */
+FileData *file_data_new_group(const gchar *path_utf8);
+
+/* should be used on helper files which can't have sidecars */
+FileData *file_data_new_no_grouping(const gchar *path_utf8);
+
+/* should be used on dirs */
+FileData *file_data_new_dir(const gchar *path_utf8);
 
 #ifdef DEBUG_FILEDATA
 FileData *file_data_ref_debug(const gchar *file, gint line, FileData *fd);
@@ -35,6 +43,11 @@ FileData *file_data_ref(FileData *fd);
 void file_data_unref(FileData *fd);
 #endif
 
+void file_data_lock(FileData *fd);
+void file_data_unlock(FileData *fd);
+void file_data_lock_list(GList *list);
+void file_data_unlock_list(GList *list);
+
 gboolean file_data_check_changed_files(FileData *fd);
 
 void file_data_increment_version(FileData *fd);