Mercurial > geeqie
annotate src/ui_fileops.h @ 1373:168e5597ddc7
overlay now survives image split
author | nadvornik |
---|---|
date | Mon, 02 Mar 2009 22:48:04 +0000 |
parents | 721ffb823d6e |
children | 4da6d326919c |
rev | line source |
---|---|
9 | 1 /* |
2 * (SLIK) SimpLIstic sKin functions | |
3 * (C) 2004 John Ellis | |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
14 #ifndef UI_FILEOPS_H | |
15 #define UI_FILEOPS_H | |
16 | |
17 | |
18 #include <sys/stat.h> | |
19 #include <sys/time.h> | |
20 #include <sys/types.h> | |
21 #include <time.h> | |
22 | |
23 | |
24 | |
25 void print_term(const gchar *text_utf8); | |
26 | |
403 | 27 #define printf_term(...) \ |
28 do { \ | |
29 gchar *msg = g_strdup_printf(__VA_ARGS__); \ | |
30 print_term(msg); \ | |
31 g_free(msg); \ | |
442 | 32 } while (0) |
403 | 33 |
9 | 34 gchar *path_to_utf8(const gchar *path); |
35 gchar *path_from_utf8(const gchar *path); | |
36 | |
1149
c4fcf8001574
Implement preliminary support for XDG Base Directory Specification.
zas_
parents:
1148
diff
changeset
|
37 const gchar *xdg_data_home_get(void); |
c4fcf8001574
Implement preliminary support for XDG Base Directory Specification.
zas_
parents:
1148
diff
changeset
|
38 const gchar *xdg_config_home_get(void); |
c4fcf8001574
Implement preliminary support for XDG Base Directory Specification.
zas_
parents:
1148
diff
changeset
|
39 const gchar *xdg_cache_home_get(void); |
9 | 40 const gchar *homedir(void); |
1145
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1055
diff
changeset
|
41 const gchar *get_rc_dir(void); |
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1055
diff
changeset
|
42 const gchar *get_collections_dir(void); |
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1055
diff
changeset
|
43 const gchar *get_trash_dir(void); |
3a7af6a8cd5f
Use functions to return directories instead of constants.
zas_
parents:
1055
diff
changeset
|
44 |
9 | 45 gint stat_utf8(const gchar *s, struct stat *st); |
40
dcc04a6a58bf
Sat Apr 16 12:29:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
46 gint lstat_utf8(const gchar *s, struct stat *st); |
1229
878718372aca
sidecar files grouping was made case-insensitive
nadvornik
parents:
1164
diff
changeset
|
47 gint stat_utf8_case_insensitive_ext(GString *base, const gchar *ext, struct stat *st); |
878718372aca
sidecar files grouping was made case-insensitive
nadvornik
parents:
1164
diff
changeset
|
48 |
878718372aca
sidecar files grouping was made case-insensitive
nadvornik
parents:
1164
diff
changeset
|
49 |
9 | 50 gint isname(const gchar *s); |
51 gint isfile(const gchar *s); | |
52 gint isdir(const gchar *s); | |
40
dcc04a6a58bf
Sat Apr 16 12:29:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
53 gint islink(const gchar *s); |
9 | 54 gint64 filesize(const gchar *s); |
55 time_t filetime(const gchar *s); | |
56 gint filetime_set(const gchar *s, time_t tval); | |
1360
721ffb823d6e
Introduce is_readable_file() which test if file exists, is regular and readable.
zas_
parents:
1284
diff
changeset
|
57 gboolean is_readable_file(const gchar *s); |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
702
diff
changeset
|
58 gint access_file(const gchar *s, gint mode); |
9 | 59 gint unlink_file(const gchar *s); |
60 gint symlink_utf8(const gchar *source, const gchar *target); | |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
702
diff
changeset
|
61 gint mkdir_utf8(const gchar *s, gint mode); |
9 | 62 gint rmdir_utf8(const gchar *s); |
63 gint copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint mtime); | |
64 gint copy_file(const gchar *s, const gchar *t); | |
65 gint move_file(const gchar *s, const gchar *t); | |
66 gint rename_file(const gchar *s, const gchar *t); | |
67 gchar *get_current_dir(void); | |
68 | |
69 /* return True on success, it is up to you to free | |
138 | 70 * the lists with string_list_free() |
9 | 71 */ |
138 | 72 void string_list_free(GList *list); |
1238
947e603a52c6
simplified metadata interface, dropped metadata_read,
nadvornik
parents:
1229
diff
changeset
|
73 GList *string_list_copy(const GList *list); |
9 | 74 |
75 gchar *unique_filename(const gchar *path, const gchar *ext, const gchar *divider, gint pad); | |
76 gchar *unique_filename_simple(const gchar *path); | |
77 | |
78 const gchar *filename_from_path(const gchar *path); | |
79 gchar *remove_level_from_path(const gchar *path); | |
80 | |
81 const gchar *extension_from_path(const gchar *path); | |
82 gchar *remove_extension_from_path(const gchar *path); | |
83 | |
84 gint file_extension_match(const gchar *path, const gchar *ext); | |
85 | |
86 /* warning note: this modifies path string! */ | |
87 void parse_out_relatives(gchar *path); | |
88 | |
89 gint file_in_path(const gchar *name); | |
90 | |
1164 | 91 gboolean recursive_mkdir_if_not_exists(const gchar *path, mode_t mode); |
1148
95860439070b
Replace cache_ensure_dir_exists() by new recursive_mkdir_if_not_exists().
zas_
parents:
1145
diff
changeset
|
92 |
9 | 93 #endif |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1000
diff
changeset
|
94 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |