annotate src/ui_fileops.h @ 1742:eb64f542341b

fixed list of possible editors in popup menu
author nadvornik
date Mon, 07 Sep 2009 20:04:22 +0000
parents 192d4752fd06
children 956aab097ea7
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 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * (SLIK) SimpLIstic sKin functions
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: 1238
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
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 #ifndef UI_FILEOPS_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #define UI_FILEOPS_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 #include <sys/stat.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 #include <sys/time.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 #include <sys/types.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 #include <time.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23
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 void print_term(const gchar *text_utf8);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26
403
2649a28d31b6 Introduce printf_term() macro and use it.
zas_
parents: 319
diff changeset
27 #define printf_term(...) \
2649a28d31b6 Introduce printf_term() macro and use it.
zas_
parents: 319
diff changeset
28 do { \
2649a28d31b6 Introduce printf_term() macro and use it.
zas_
parents: 319
diff changeset
29 gchar *msg = g_strdup_printf(__VA_ARGS__); \
2649a28d31b6 Introduce printf_term() macro and use it.
zas_
parents: 319
diff changeset
30 print_term(msg); \
2649a28d31b6 Introduce printf_term() macro and use it.
zas_
parents: 319
diff changeset
31 g_free(msg); \
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 403
diff changeset
32 } while (0)
403
2649a28d31b6 Introduce printf_term() macro and use it.
zas_
parents: 319
diff changeset
33
1386
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
34 #if GQ_DEBUG_PATH_UTF8
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
35 #define path_to_utf8(path) path_to_utf8_debug(path, __FILE__, __LINE__)
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
36 #define path_from_utf8(utf8) path_from_utf8_debug(utf8, __FILE__, __LINE__)
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
37 gchar *path_to_utf8_debug(const gchar *path, const gchar *file, gint line);
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
38 gchar *path_from_utf8_debug(const gchar *utf8, const gchar *file, gint line);
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
39 #else
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
40 gchar *path_to_utf8(const gchar *path);
1386
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
41 gchar *path_from_utf8(const gchar *utf8);
4da6d326919c Add debug versions of path_to_utf8() and path_from_utf8() which allows to report the caller file and line, this is enabled with --enable-debug-flags (and developer mode too).
zas_
parents: 1360
diff changeset
42 #endif
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43
1149
c4fcf8001574 Implement preliminary support for XDG Base Directory Specification.
zas_
parents: 1148
diff changeset
44 const gchar *xdg_data_home_get(void);
c4fcf8001574 Implement preliminary support for XDG Base Directory Specification.
zas_
parents: 1148
diff changeset
45 const gchar *xdg_config_home_get(void);
c4fcf8001574 Implement preliminary support for XDG Base Directory Specification.
zas_
parents: 1148
diff changeset
46 const gchar *xdg_cache_home_get(void);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 const gchar *homedir(void);
1145
3a7af6a8cd5f Use functions to return directories instead of constants.
zas_
parents: 1055
diff changeset
48 const gchar *get_rc_dir(void);
3a7af6a8cd5f Use functions to return directories instead of constants.
zas_
parents: 1055
diff changeset
49 const gchar *get_collections_dir(void);
3a7af6a8cd5f Use functions to return directories instead of constants.
zas_
parents: 1055
diff changeset
50 const gchar *get_trash_dir(void);
3a7af6a8cd5f Use functions to return directories instead of constants.
zas_
parents: 1055
diff changeset
51
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
52 gboolean stat_utf8(const gchar *s, struct stat *st);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
53 gboolean lstat_utf8(const gchar *s, struct stat *st);
1229
878718372aca sidecar files grouping was made case-insensitive
nadvornik
parents: 1164
diff changeset
54
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
55 gboolean isname(const gchar *s);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
56 gboolean isfile(const gchar *s);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
57 gboolean isdir(const gchar *s);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
58 gboolean islink(const gchar *s);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 gint64 filesize(const gchar *s);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
60 time_t filetime(const gchar *s);
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
61 gboolean 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
62 gboolean is_readable_file(const gchar *s);
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
63 gboolean access_file(const gchar *s, gint mode);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
64 gboolean unlink_file(const gchar *s);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
65 gboolean symlink_utf8(const gchar *source, const gchar *target);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
66 gboolean mkdir_utf8(const gchar *s, gint mode);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
67 gboolean rmdir_utf8(const gchar *s);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
68 gboolean copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint mtime);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
69 gboolean copy_file(const gchar *s, const gchar *t);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
70 gboolean move_file(const gchar *s, const gchar *t);
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
71 gboolean rename_file(const gchar *s, const gchar *t);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 gchar *get_current_dir(void);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
74 /* return True on success, it is up to you to free
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 112
diff changeset
75 * the lists with string_list_free()
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76 */
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 112
diff changeset
77 void string_list_free(GList *list);
1238
947e603a52c6 simplified metadata interface, dropped metadata_read,
nadvornik
parents: 1229
diff changeset
78 GList *string_list_copy(const GList *list);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
80 gchar *unique_filename(const gchar *path, const gchar *ext, const gchar *divider, gboolean pad);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81 gchar *unique_filename_simple(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
82
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 const gchar *filename_from_path(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 gchar *remove_level_from_path(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86 const gchar *extension_from_path(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
87 gchar *remove_extension_from_path(const gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
88
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
89 gboolean file_extension_match(const gchar *path, const gchar *ext);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
90
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
91 /* warning note: this modifies path string! */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
92 void parse_out_relatives(gchar *path);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
93
1448
89dedc61b1bd gint -> gboolean.
zas_
parents: 1386
diff changeset
94 gboolean file_in_path(const gchar *name);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
95
1164
3692efcbd325 Fix compilation warnings.
zas_
parents: 1149
diff changeset
96 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
97
1642
51d70f62338c Fix up compilation using make -jN: sometimes it fails due to order of headers inclusion.
zas_
parents: 1448
diff changeset
98
51d70f62338c Fix up compilation using make -jN: sometimes it fails due to order of headers inclusion.
zas_
parents: 1448
diff changeset
99 /* generate md5 string from file,
51d70f62338c Fix up compilation using make -jN: sometimes it fails due to order of headers inclusion.
zas_
parents: 1448
diff changeset
100 * on failure returns newly allocated copy of error_text, error_text may be NULL
51d70f62338c Fix up compilation using make -jN: sometimes it fails due to order of headers inclusion.
zas_
parents: 1448
diff changeset
101 */
51d70f62338c Fix up compilation using make -jN: sometimes it fails due to order of headers inclusion.
zas_
parents: 1448
diff changeset
102 gchar *md5_text_from_file_utf8(const gchar *path, const gchar *error_text);
51d70f62338c Fix up compilation using make -jN: sometimes it fails due to order of headers inclusion.
zas_
parents: 1448
diff changeset
103 gboolean md5_get_digest_from_file_utf8(const gchar *path, guchar digest[16]);
51d70f62338c Fix up compilation using make -jN: sometimes it fails due to order of headers inclusion.
zas_
parents: 1448
diff changeset
104
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105 #endif
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1000
diff changeset
106 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */