annotate src/filedata.h @ 1692:bb964a9d9bb8

fixed possible crash in exif_item_get_integer
author nadvornik
date Tue, 18 Aug 2009 20:19:23 +0000
parents 011e8dbda7f2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 170
diff changeset
2 * Geeqie
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1224
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13
586
905688aa2317 split filelist.c to filefilter.c and filedata.c
nadvornik
parents: 576
diff changeset
14 #ifndef FILEDATA_H
905688aa2317 split filelist.c to filefilter.c and filedata.c
nadvornik
parents: 576
diff changeset
15 #define FILEDATA_H
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16
874
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
17 #ifdef DEBUG
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
18 #define DEBUG_FILEDATA
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
19 #endif
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
20
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 gchar *text_from_size(gint64 size);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 gchar *text_from_size_abrev(gint64 size);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23 const gchar *text_from_time(time_t t);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 /* this expects a utf-8 path */
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
26 FileData *file_data_new_simple(const gchar *path_utf8);
145
8be2cc687304 fixed grouping sidecar files and made it configurable via config file
nadvornik
parents: 143
diff changeset
27
874
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
28 #ifdef DEBUG_FILEDATA
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
29 FileData *file_data_ref_debug(const gchar *file, gint line, FileData *fd);
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
30 void file_data_unref_debug(const gchar *file, gint line, FileData *fd);
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
31 #define file_data_ref(fd) file_data_ref_debug(__FILE__, __LINE__, fd)
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
32 #define file_data_unref(fd) file_data_unref_debug(__FILE__, __LINE__, fd)
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
33 #else
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
34 FileData *file_data_ref(FileData *fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
35 void file_data_unref(FileData *fd);
874
fa39a4d786ad Increase debugging info in file_data_ref() and file_data_unref().
zas_
parents: 849
diff changeset
36 #endif
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37
888
d8e1e820cee7 reload changed images
nadvornik
parents: 874
diff changeset
38 gboolean file_data_check_changed_files(FileData *fd);
d8e1e820cee7 reload changed images
nadvornik
parents: 874
diff changeset
39
763
81f9e8dbb4bf improved infrastructure for tracing changes, optimized vflist_populate_view
nadvornik
parents: 753
diff changeset
40 void file_data_increment_version(FileData *fd);
81f9e8dbb4bf improved infrastructure for tracing changes, optimized vflist_populate_view
nadvornik
parents: 753
diff changeset
41
143
0d1bf3ac6cd8 improved FileDataChangeInfo structure, check for another file operation in progress
nadvornik
parents: 139
diff changeset
42 gboolean file_data_add_change_info(FileData *fd, FileDataChangeType type, const gchar *src, const gchar *dest);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
43 void file_data_change_info_free(FileDataChangeInfo *fdci, FileData *fd);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
44
849
db68d673448f added possibility to disable grouping of selected files
nadvornik
parents: 800
diff changeset
45 void file_data_disable_grouping(FileData *fd, gboolean disable);
1599
b8e2690c440a expose the file grouping flag to the user
nadvornik
parents: 1425
diff changeset
46 void file_data_disable_grouping_list(GList *fd_list, gboolean disable);
849
db68d673448f added possibility to disable grouping of selected files
nadvornik
parents: 800
diff changeset
47
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
48 gint filelist_sort_compare_filedata(FileData *fa, FileData *fb);
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
49 gint filelist_sort_compare_filedata_full(FileData *fa, FileData *fb, SortType method, gboolean ascend);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
50 GList *filelist_sort(GList *list, SortType method, gboolean ascend);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
51 GList *filelist_insert_sort(GList *list, FileData *fd, SortType method, gboolean ascend);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
52 GList *filelist_sort_full(GList *list, SortType method, gboolean ascend, GCompareFunc cb);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
53 GList *filelist_insert_sort_full(GList *list, gpointer data, SortType method, gboolean ascend, GCompareFunc cb);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
55 gboolean filelist_read(FileData *dir_fd, GList **files, GList **dirs);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
56 gboolean filelist_read_lstat(FileData *dir_fd, GList **files, GList **dirs);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 void filelist_free(GList *list);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
58 GList *filelist_copy(GList *list);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
59 GList *filelist_from_path_list(GList *list);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
60 GList *filelist_to_path_list(GList *list);
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
61
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
62 GList *filelist_filter(GList *list, gboolean is_dir_list);
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
63
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 9
diff changeset
64 GList *filelist_sort_path(GList *list);
783
d6a7fb4b8e7c replaced directory path with FileData* dir_fd
nadvornik
parents: 763
diff changeset
65 GList *filelist_recursive(FileData *dir_fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66
1222
31dc2f240afb low-level keyword-to-mark functionality
nadvornik
parents: 1205
diff changeset
67 typedef gboolean (* FileDataGetMarkFunc)(FileData *fd, gint n, gpointer data);
31dc2f240afb low-level keyword-to-mark functionality
nadvornik
parents: 1205
diff changeset
68 typedef gboolean (* FileDataSetMarkFunc)(FileData *fd, gint n, gboolean value, gpointer data);
1425
80462be81410 fixed keyword to mark connection
nadvornik
parents: 1422
diff changeset
69 gboolean file_data_register_mark_func(gint n, FileDataGetMarkFunc get_mark_func, FileDataSetMarkFunc set_mark_func, gpointer data, GDestroyNotify notify);
1222
31dc2f240afb low-level keyword-to-mark functionality
nadvornik
parents: 1205
diff changeset
70 void file_data_get_registered_mark_func(gint n, FileDataGetMarkFunc *get_mark_func, FileDataSetMarkFunc *set_mark_func, gpointer *data);
31dc2f240afb low-level keyword-to-mark functionality
nadvornik
parents: 1205
diff changeset
71
31dc2f240afb low-level keyword-to-mark functionality
nadvornik
parents: 1205
diff changeset
72
800
a25b228978a0 various notification improvements
nadvornik
parents: 792
diff changeset
73 gboolean file_data_get_mark(FileData *fd, gint n);
966
c24a297efbef marks in iconview made clickable
nadvornik
parents: 964
diff changeset
74 guint file_data_get_marks(FileData *fd);
800
a25b228978a0 various notification improvements
nadvornik
parents: 792
diff changeset
75 void file_data_set_mark(FileData *fd, gint n, gboolean value);
964
ba1d3c4bc0cd implemented marks filter
nadvornik
parents: 928
diff changeset
76 gboolean file_data_filter_marks(FileData *fd, guint filter);
ba1d3c4bc0cd implemented marks filter
nadvornik
parents: 928
diff changeset
77 GList *file_data_filter_marks_list(GList *list, guint filter);
ba1d3c4bc0cd implemented marks filter
nadvornik
parents: 928
diff changeset
78
800
a25b228978a0 various notification improvements
nadvornik
parents: 792
diff changeset
79 gint file_data_get_user_orientation(FileData *fd);
a25b228978a0 various notification improvements
nadvornik
parents: 792
diff changeset
80 void file_data_set_user_orientation(FileData *fd, gint value);
a25b228978a0 various notification improvements
nadvornik
parents: 792
diff changeset
81
590
2b7b966f61cf started implementation of API for sidecar files
nadvornik
parents: 586
diff changeset
82 gchar *file_data_sc_list_to_string(FileData *fd);
1224
ebfd305d902e improved sidecar writting
nadvornik
parents: 1222
diff changeset
83
ebfd305d902e improved sidecar writting
nadvornik
parents: 1222
diff changeset
84 gchar *file_data_get_sidecar_path(FileData *fd, gboolean existing_only);
ebfd305d902e improved sidecar writting
nadvornik
parents: 1222
diff changeset
85
ebfd305d902e improved sidecar writting
nadvornik
parents: 1222
diff changeset
86
590
2b7b966f61cf started implementation of API for sidecar files
nadvornik
parents: 586
diff changeset
87 gboolean file_data_add_ci(FileData *fd, FileDataChangeType type, const gchar *src, const gchar *dest);
751
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
88 gboolean file_data_sc_add_ci_copy(FileData *fd, const gchar *dest_path);
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
89 gboolean file_data_sc_add_ci_move(FileData *fd, const gchar *dest_path);
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
90 gboolean file_data_sc_add_ci_rename(FileData *fd, const gchar *dest_path);
590
2b7b966f61cf started implementation of API for sidecar files
nadvornik
parents: 586
diff changeset
91 gboolean file_data_sc_add_ci_delete(FileData *fd);
753
477f48ba28d8 rewritten utilops.h:
nadvornik
parents: 751
diff changeset
92 gboolean file_data_sc_add_ci_unspecified(FileData *fd, const gchar *dest_path);
751
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
93
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
94 gboolean file_data_sc_add_ci_delete_list(GList *fd_list);
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
95 gboolean file_data_sc_add_ci_copy_list(GList *fd_list, const gchar *dest);
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
96 gboolean file_data_sc_add_ci_move_list(GList *fd_list, const gchar *dest);
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
97 gboolean file_data_sc_add_ci_rename_list(GList *fd_list, const gchar *dest);
753
477f48ba28d8 rewritten utilops.h:
nadvornik
parents: 751
diff changeset
98 gboolean file_data_sc_add_ci_unspecified_list(GList *fd_list, const gchar *dest);
1205
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
99 gboolean file_data_add_ci_write_metadata_list(GList *fd_list);
751
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
100
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
101 gboolean file_data_sc_update_ci_copy_list(GList *fd_list, const gchar *dest);
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
102 gboolean file_data_sc_update_ci_move_list(GList *fd_list, const gchar *dest);
753
477f48ba28d8 rewritten utilops.h:
nadvornik
parents: 751
diff changeset
103 gboolean file_data_sc_update_ci_unspecified_list(GList *fd_list, const gchar *dest);
751
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
104
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
105
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
106 gboolean file_data_sc_update_ci_copy(FileData *fd, const gchar *dest_path);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
107 gboolean file_data_sc_update_ci_move(FileData *fd, const gchar *dest_path);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
108 gboolean file_data_sc_update_ci_rename(FileData *fd, const gchar *dest_path);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
109 gboolean file_data_sc_update_ci_unspecified(FileData *fd, const gchar *dest_path);
1205
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
110
928
6a42ab7051f2 improved error reporting
nadvornik
parents: 888
diff changeset
111 gchar *file_data_get_error_string(gint error);
1205
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
112
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
113 gint file_data_verify_ci(FileData *fd);
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
114 gint file_data_verify_ci_list(GList *list, gchar **desc, gboolean with_sidecars);
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
115
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
116 gboolean file_data_perform_ci(FileData *fd);
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
117 gboolean file_data_apply_ci(FileData *fd);
1205
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
118 void file_data_free_ci(FileData *fd);
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
119 void file_data_free_ci_list(GList *fd_list);
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
120
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
121
3ff2aa99108b use the workflow in utilops.c for metadata approving and writting
nadvornik
parents: 1055
diff changeset
122 gint file_data_sc_verify_ci(FileData *fd);
928
6a42ab7051f2 improved error reporting
nadvornik
parents: 888
diff changeset
123
590
2b7b966f61cf started implementation of API for sidecar files
nadvornik
parents: 586
diff changeset
124 gboolean file_data_sc_perform_ci(FileData *fd);
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
125 gboolean file_data_sc_apply_ci(FileData *fd);
751
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
126 void file_data_sc_free_ci(FileData *fd);
f73df252aa05 improved filedata interface
nadvornik
parents: 596
diff changeset
127 void file_data_sc_free_ci_list(GList *fd_list);
590
2b7b966f61cf started implementation of API for sidecar files
nadvornik
parents: 586
diff changeset
128
1619
011e8dbda7f2 changed selection behavior as requested at
nadvornik
parents: 1599
diff changeset
129 GList *file_data_process_groups(GList *list);
011e8dbda7f2 changed selection behavior as requested at
nadvornik
parents: 1599
diff changeset
130
011e8dbda7f2 changed selection behavior as requested at
nadvornik
parents: 1599
diff changeset
131
792
99ea3d973ad3 added NotifyType
nadvornik
parents: 791
diff changeset
132 typedef void (*FileDataNotifyFunc)(FileData *fd, NotifyType type, gpointer data);
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
133 gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
134 gboolean file_data_unregister_notify_func(FileDataNotifyFunc func, gpointer data);
792
99ea3d973ad3 added NotifyType
nadvornik
parents: 791
diff changeset
135 void file_data_send_notification(FileData *fd, NotifyType type);
791
6d65167764ea realtime file monitor
nadvornik
parents: 784
diff changeset
136
1422
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
137 gboolean file_data_register_real_time_monitor(FileData *fd);
91bed0d66cf2 gint -> gboolean and tidy up.
zas_
parents: 1284
diff changeset
138 gboolean file_data_unregister_real_time_monitor(FileData *fd);
791
6d65167764ea realtime file monitor
nadvornik
parents: 784
diff changeset
139
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140 #endif
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1002
diff changeset
141 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */