Mercurial > geeqie
annotate src/ui_fileops.h @ 516:b7e99bfeadc9
Convert the minority of while() to while ().
author | zas_ |
---|---|
date | Thu, 24 Apr 2008 15:49:57 +0000 |
parents | 48c8e49b571c |
children | e421326e8b43 |
rev | line source |
---|---|
9 | 1 /* |
2 * (SLIK) SimpLIstic sKin functions | |
3 * (C) 2004 John Ellis | |
475 | 4 * Copyright (C) 2008 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 | |
37 const gchar *homedir(void); | |
38 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
|
39 gint lstat_utf8(const gchar *s, struct stat *st); |
9 | 40 gint isname(const gchar *s); |
41 gint isfile(const gchar *s); | |
42 gint isdir(const gchar *s); | |
40
dcc04a6a58bf
Sat Apr 16 12:29:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
9
diff
changeset
|
43 gint islink(const gchar *s); |
9 | 44 gint64 filesize(const gchar *s); |
45 time_t filetime(const gchar *s); | |
46 gint filetime_set(const gchar *s, time_t tval); | |
47 gint access_file(const gchar *s, int mode); | |
48 gint unlink_file(const gchar *s); | |
49 gint symlink_utf8(const gchar *source, const gchar *target); | |
50 gint mkdir_utf8(const gchar *s, int mode); | |
51 gint rmdir_utf8(const gchar *s); | |
52 gint copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint mtime); | |
53 gint copy_file(const gchar *s, const gchar *t); | |
54 gint move_file(const gchar *s, const gchar *t); | |
55 gint rename_file(const gchar *s, const gchar *t); | |
56 gchar *get_current_dir(void); | |
57 | |
58 /* return True on success, it is up to you to free | |
138 | 59 * the lists with string_list_free() |
9 | 60 */ |
61 gint path_list(const gchar *path, GList **files, GList **dirs); | |
112
b15d4c18168f
Fri Nov 17 19:06:19 2006 John Ellis <johne@verizon.net>
gqview
parents:
40
diff
changeset
|
62 gint path_list_lstat(const gchar *path, GList **files, GList **dirs); |
138 | 63 void string_list_free(GList *list); |
64 #define path_list_free string_list_free | |
65 GList *string_list_copy(GList *list); | |
66 #define path_list_copy string_list_copy | |
9 | 67 |
68 long checksum_simple(const gchar *path); | |
69 | |
70 | |
71 gchar *unique_filename(const gchar *path, const gchar *ext, const gchar *divider, gint pad); | |
72 gchar *unique_filename_simple(const gchar *path); | |
73 | |
74 const gchar *filename_from_path(const gchar *path); | |
75 gchar *remove_level_from_path(const gchar *path); | |
76 gchar *concat_dir_and_file(const gchar *base, const gchar *name); | |
77 | |
78 const gchar *extension_from_path(const gchar *path); | |
79 gchar *remove_extension_from_path(const gchar *path); | |
80 | |
81 gint file_extension_match(const gchar *path, const gchar *ext); | |
82 | |
83 /* warning note: this modifies path string! */ | |
84 void parse_out_relatives(gchar *path); | |
85 | |
86 gint file_in_path(const gchar *name); | |
87 | |
88 #endif |