Sync to GQview 1.5.9 release.
[geeqie.git] / src / filelist.h
1 /*
2  * GQview
3  * (C) 2004 John Ellis
4  *
5  * Author: John Ellis
6  *
7  * This software is released under the GNU General Public License (GNU GPL).
8  * Please read the included file COPYING for more information.
9  * This software comes with no warranty of any kind, use at your own risk!
10  */
11
12
13 #ifndef FILELIST_H
14 #define FILELIST_H
15
16
17 typedef struct _FilterEntry FilterEntry;
18 struct _FilterEntry {
19         gchar *key;
20         gchar *description;
21         gchar *extensions;
22         gint enabled;
23 };
24
25 /* you can change, but not add or remove entries from the returned list */
26 GList *filter_get_list(void);
27 void filter_remove_entry(FilterEntry *fe);
28
29 void filter_add(const gchar *key, const gchar *description, const gchar *extensions, gint enabled);
30 void filter_add_unique(const gchar *description, const gchar *extensions, gint enabled);
31 void filter_add_defaults(void);
32 void filter_reset(void);
33 void filter_rebuild(void);
34
35 gint filter_name_exists(const gchar *name);
36
37 void filter_write_list(FILE *f);
38 void filter_parse(const gchar *text);
39
40 gint ishidden(const gchar *name);
41
42
43 GList *path_list_filter(GList *list, gint is_dir_list);
44
45 GList *path_list_sort(GList *list);
46 GList *path_list_recursive(const gchar *path);
47
48 gchar *text_from_size(gint64 size);
49 gchar *text_from_size_abrev(gint64 size);
50 const gchar *text_from_time(time_t t);
51
52 /* this expects a locale encoded path */
53 FileData *file_data_new(const gchar *path, struct stat *st);
54 /* this expects a utf-8 path */
55 FileData *file_data_new_simple(const gchar *path);
56 void file_data_free(FileData *fd);
57
58 GList *filelist_sort(GList *list, SortType method, gint ascend);
59 GList *filelist_insert_sort(GList *list, FileData *fd, SortType method, gint ascend);
60
61 gint filelist_read(const gchar *path, GList **files, GList **dirs);
62 void filelist_free(GList *list);
63
64 #endif
65
66