diff options
author | rbuj <[email protected]> | 2021-10-27 17:40:17 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-12-11 15:59:33 +0100 |
commit | 6c55334ad9b03006686e2db6c6f6167677a2f510 (patch) | |
tree | b558cc0ad6d97c36b449dbcb2afecb3b9002a565 /src/gio-utils.c | |
parent | 85909393571d91b3c267afe5341e54bfae5a6d50 (diff) | |
download | engrampa-6c55334ad9b03006686e2db6c6f6167677a2f510.tar.bz2 engrampa-6c55334ad9b03006686e2db6c6f6167677a2f510.tar.xz |
Use a blank line at most
Diffstat (limited to 'src/gio-utils.c')
-rw-r--r-- | src/gio-utils.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/gio-utils.c b/src/gio-utils.c index b1acd3d..5f66e1f 100644 --- a/src/gio-utils.c +++ b/src/gio-utils.c @@ -27,13 +27,10 @@ #include "file-utils.h" #include "gio-utils.h" - #define N_FILES_PER_REQUEST 128 - /* -- filter -- */ - typedef enum { FILTER_DEFAULT = 0, FILTER_NODOTFILES = 1 << 1, @@ -41,14 +38,12 @@ typedef enum { FILTER_NOBACKUPFILES = 1 << 3 } FilterOptions; - typedef struct { char *pattern; FilterOptions options; GRegex **regexps; } Filter; - static Filter * filter_new (const char *pattern, FilterOptions options) @@ -71,7 +66,6 @@ filter_new (const char *pattern, return filter; } - static void filter_destroy (Filter *filter) { @@ -84,7 +78,6 @@ filter_destroy (Filter *filter) g_free (filter); } - static gboolean filter_matches (Filter *filter, const char *name) @@ -115,17 +108,14 @@ filter_matches (Filter *filter, return matched; } - static gboolean filter_empty (Filter *filter) { return ((filter->pattern == NULL) || (strcmp (filter->pattern, "*") == 0)); } - /* -- g_directory_foreach_child -- */ - typedef struct { GFile *base_directory; gboolean recursive; @@ -146,7 +136,6 @@ typedef struct { guint source_id; } ForEachChildData; - static void for_each_child_data_free (ForEachChildData *fec) { @@ -164,7 +153,6 @@ for_each_child_data_free (ForEachChildData *fec) g_free (fec); } - static gboolean for_each_child_done_cb (gpointer user_data) { @@ -182,17 +170,14 @@ for_each_child_done_cb (gpointer user_data) return FALSE; } - static void for_each_child_done (ForEachChildData *fec) { fec->source_id = g_idle_add (for_each_child_done_cb, fec); } - static void for_each_child_start_current (ForEachChildData *fec); - static gboolean for_each_child_start_cb (gpointer user_data) { @@ -204,14 +189,12 @@ for_each_child_start_cb (gpointer user_data) return FALSE; } - static void for_each_child_start (ForEachChildData *fec) { fec->source_id = g_idle_add (for_each_child_start_cb, fec); } - static void for_each_child_set_current_uri (ForEachChildData *fec, const char *directory) @@ -221,7 +204,6 @@ for_each_child_set_current_uri (ForEachChildData *fec, fec->current = g_file_new_for_uri (directory); } - static void for_each_child_set_current (ForEachChildData *fec, GFile *directory) @@ -253,7 +235,6 @@ for_each_child_start_next_sub_directory (ForEachChildData *fec) for_each_child_done (fec); } - static void for_each_child_close_enumerator (GObject *source_object, GAsyncResult *result, @@ -278,7 +259,6 @@ for_each_child_close_enumerator (GObject *source_object, for_each_child_done (fec); } - static void for_each_child_next_files_ready (GObject *source_object, GAsyncResult *result, @@ -355,7 +335,6 @@ for_each_child_ready (GObject *source_object, fec); } - static void for_each_child_start_current (ForEachChildData *fec) { @@ -444,10 +423,8 @@ g_directory_foreach_child (GFile *directory, for_each_child_start_current (fec); } - /* -- get_file_list_data -- */ - typedef struct { GList *files; GList *dirs; @@ -464,7 +441,6 @@ typedef struct { guint visit_timeout; } GetFileListData; - static void get_file_list_data_free (GetFileListData *gfl) { @@ -484,10 +460,8 @@ get_file_list_data_free (GetFileListData *gfl) g_free (gfl); } - /* -- g_directory_list_async -- */ - static GList* get_relative_file_list (GList *rel_list, GList *file_list, @@ -513,7 +487,6 @@ get_relative_file_list (GList *rel_list, return rel_list; } - static GList* get_dir_list_from_file_list (GHashTable *h_dirs, const char *base_dir, @@ -565,7 +538,6 @@ get_dir_list_from_file_list (GHashTable *h_dirs, return dir_list; } - static void get_file_list_done (GError *error, gpointer user_data) @@ -636,7 +608,6 @@ get_file_list_done (GError *error, get_file_list_data_free (gfl); } - static void get_file_list_for_each_file (const char *uri, GFileInfo *info, @@ -655,7 +626,6 @@ get_file_list_for_each_file (const char *uri, } } - static DirOp get_file_list_start_dir (const char *uri, GError **error, @@ -671,7 +641,6 @@ get_file_list_start_dir (const char *uri, return DIR_OP_SKIP; } - void g_directory_list_async (const char *directory, const char *base_dir, @@ -717,13 +686,10 @@ g_directory_list_async (const char *directory, gfl); } - /* -- g_list_items_async -- */ - static void get_items_for_current_dir (GetFileListData *gfl); - static gboolean get_items_for_next_dir_idle_cb (gpointer data) { @@ -738,7 +704,6 @@ get_items_for_next_dir_idle_cb (gpointer data) return FALSE; } - static void get_items_for_current_dir_done (GList *files, GList *dirs, @@ -762,7 +727,6 @@ get_items_for_current_dir_done (GList *files, gfl->visit_timeout = g_idle_add (get_items_for_next_dir_idle_cb, gfl); } - static void get_items_for_current_dir (GetFileListData *gfl) { @@ -803,7 +767,6 @@ get_items_for_current_dir (GetFileListData *gfl) g_object_unref (current_dir); } - void g_list_items_async (GList *items, const char *base_dir, @@ -844,10 +807,8 @@ g_list_items_async (GList *items, get_items_for_current_dir (gfl); } - /* -- g_copy_files_async -- */ - typedef struct { GList *sources; GList *destinations; @@ -865,7 +826,6 @@ typedef struct { int tot_files; } CopyFilesData; - static CopyFilesData* copy_files_data_new (GList *sources, GList *destinations, @@ -898,7 +858,6 @@ copy_files_data_new (GList *sources, return cfd; } - static void copy_files_data_free (CopyFilesData *cfd) { @@ -909,10 +868,8 @@ copy_files_data_free (CopyFilesData *cfd) g_free (cfd); } - static void g_copy_current_file (CopyFilesData *cfd); - static void g_copy_next_file (CopyFilesData *cfd) { @@ -923,7 +880,6 @@ g_copy_next_file (CopyFilesData *cfd) g_copy_current_file (cfd); } - static void g_copy_files_ready_cb (GObject *source_object, GAsyncResult *result, @@ -957,7 +913,6 @@ g_copy_files_ready_cb (GObject *source_object, g_copy_next_file (cfd); } - static void g_copy_files_progress_cb (goffset current_num_bytes, goffset total_num_bytes, @@ -975,7 +930,6 @@ g_copy_files_progress_cb (goffset current_num_bytes, cfd->progress_callback_data); } - static void g_copy_current_file (CopyFilesData *cfd) { @@ -997,7 +951,6 @@ g_copy_current_file (CopyFilesData *cfd) cfd); } - void g_copy_files_async (GList *sources, GList *destinations, @@ -1023,7 +976,6 @@ g_copy_files_async (GList *sources, g_copy_current_file (cfd); } - void g_copy_file_async (GFile *source, GFile *destination, @@ -1055,16 +1007,13 @@ g_copy_file_async (GFile *source, g_list_free (destination_files); } - /* -- g_directory_copy_async -- */ - typedef struct { char *uri; GFileInfo *info; } ChildData; - static ChildData* child_data_new (const char *uri, GFileInfo *info) @@ -1078,7 +1027,6 @@ child_data_new (const char *uri, return data; } - static void child_data_free (ChildData *child) { @@ -1089,7 +1037,6 @@ child_data_free (ChildData *child) g_free (child); } - typedef struct { GFile *source; GFile *destination; @@ -1110,7 +1057,6 @@ typedef struct { guint source_id; } DirectoryCopyData; - static void directory_copy_data_free (DirectoryCopyData *dcd) { @@ -1133,7 +1079,6 @@ directory_copy_data_free (DirectoryCopyData *dcd) g_free (dcd); } - static gboolean g_directory_copy_done (gpointer user_data) { @@ -1150,7 +1095,6 @@ g_directory_copy_done (gpointer user_data) return FALSE; } - static GFile * get_destination_for_uri (DirectoryCopyData *dcd, const char *uri) @@ -1172,10 +1116,8 @@ get_destination_for_uri (DirectoryCopyData *dcd, return destination_file; } - static void g_directory_copy_current_child (DirectoryCopyData *dcd); - static gboolean g_directory_copy_next_child (gpointer user_data) { @@ -1190,7 +1132,6 @@ g_directory_copy_next_child (gpointer user_data) return FALSE; } - static void g_directory_copy_child_done_cb (GObject *source_object, GAsyncResult *result, @@ -1206,7 +1147,6 @@ g_directory_copy_child_done_cb (GObject *source_object, dcd->source_id = g_idle_add (g_directory_copy_next_child, dcd); } - static void g_directory_copy_child_progress_cb (goffset current_num_bytes, goffset total_num_bytes, @@ -1224,7 +1164,6 @@ g_directory_copy_child_progress_cb (goffset current_num_bytes, dcd->progress_callback_data); } - static void g_directory_copy_current_child (DirectoryCopyData *dcd) { @@ -1312,7 +1251,6 @@ g_directory_copy_current_child (DirectoryCopyData *dcd) dcd->source_id = g_idle_add (g_directory_copy_next_child, dcd); } - static gboolean g_directory_copy_start_copying (gpointer user_data) { @@ -1328,7 +1266,6 @@ g_directory_copy_start_copying (gpointer user_data) return FALSE; } - static void g_directory_copy_list_ready (GError *error, gpointer user_data) @@ -1344,7 +1281,6 @@ g_directory_copy_list_ready (GError *error, dcd->source_id = g_idle_add (g_directory_copy_start_copying, dcd); } - static void g_directory_copy_for_each_file (const char *uri, GFileInfo *info, @@ -1356,7 +1292,6 @@ g_directory_copy_for_each_file (const char *uri, dcd->tot_files++; } - static DirOp g_directory_copy_start_dir (const char *uri, GError **error, @@ -1375,7 +1310,6 @@ g_directory_copy_start_dir (const char *uri, return DIR_OP_CONTINUE; } - void g_directory_copy_async (const char *source, const char *destination, @@ -1411,7 +1345,6 @@ g_directory_copy_async (const char *source, dcd); } - gboolean g_load_file_in_buffer (GFile *file, void *buffer, |