2 * (SLIK) SimpLIstic sKin functions
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!
19 #include <sys/types.h>
24 void print_term(const gchar *text_utf8);
26 #define printf_term(...) \
28 gchar *msg = g_strdup_printf(__VA_ARGS__); \
33 gchar *path_to_utf8(const gchar *path);
34 gchar *path_from_utf8(const gchar *path);
36 const gchar *homedir(void);
37 gint stat_utf8(const gchar *s, struct stat *st);
38 gint lstat_utf8(const gchar *s, struct stat *st);
39 gint isname(const gchar *s);
40 gint isfile(const gchar *s);
41 gint isdir(const gchar *s);
42 gint islink(const gchar *s);
43 gint64 filesize(const gchar *s);
44 time_t filetime(const gchar *s);
45 gint filetime_set(const gchar *s, time_t tval);
46 gint access_file(const gchar *s, int mode);
47 gint unlink_file(const gchar *s);
48 gint symlink_utf8(const gchar *source, const gchar *target);
49 gint mkdir_utf8(const gchar *s, int mode);
50 gint rmdir_utf8(const gchar *s);
51 gint copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint mtime);
52 gint copy_file(const gchar *s, const gchar *t);
53 gint move_file(const gchar *s, const gchar *t);
54 gint rename_file(const gchar *s, const gchar *t);
55 gchar *get_current_dir(void);
57 /* return True on success, it is up to you to free
58 * the lists with string_list_free()
60 gint path_list(const gchar *path, GList **files, GList **dirs);
61 gint path_list_lstat(const gchar *path, GList **files, GList **dirs);
62 void string_list_free(GList *list);
63 #define path_list_free string_list_free
64 GList *string_list_copy(GList *list);
65 #define path_list_copy string_list_copy
67 long checksum_simple(const gchar *path);
70 gchar *unique_filename(const gchar *path, const gchar *ext, const gchar *divider, gint pad);
71 gchar *unique_filename_simple(const gchar *path);
73 const gchar *filename_from_path(const gchar *path);
74 gchar *remove_level_from_path(const gchar *path);
75 gchar *concat_dir_and_file(const gchar *base, const gchar *name);
77 const gchar *extension_from_path(const gchar *path);
78 gchar *remove_extension_from_path(const gchar *path);
80 gint file_extension_match(const gchar *path, const gchar *ext);
82 /* warning note: this modifies path string! */
83 void parse_out_relatives(gchar *path);
85 gint file_in_path(const gchar *name);