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/fr-archive.c | |
parent | 85909393571d91b3c267afe5341e54bfae5a6d50 (diff) | |
download | engrampa-6c55334ad9b03006686e2db6c6f6167677a2f510.tar.bz2 engrampa-6c55334ad9b03006686e2db6c6f6167677a2f510.tar.xz |
Use a blank line at most
Diffstat (limited to 'src/fr-archive.c')
-rw-r--r-- | src/fr-archive.c | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/src/fr-archive.c b/src/fr-archive.c index 3d53f58..301968f 100644 --- a/src/fr-archive.c +++ b/src/fr-archive.c @@ -50,10 +50,8 @@ #define NCARGS _POSIX_ARG_MAX #endif - /* -- DroppedItemsData -- */ - typedef struct { FrArchive *archive; GList *item_list; @@ -66,7 +64,6 @@ typedef struct { guint volume_size; } DroppedItemsData; - static DroppedItemsData * dropped_items_data_new (FrArchive *archive, GList *item_list, @@ -97,7 +94,6 @@ dropped_items_data_new (FrArchive *archive, return data; } - static void dropped_items_data_free (DroppedItemsData *data) { @@ -110,7 +106,6 @@ dropped_items_data_free (DroppedItemsData *data) g_free (data); } - struct _FrArchivePrivData { FakeLoadFunc fake_load_func; /* If returns TRUE, archives are not read when * fr_archive_load is invoked, used @@ -127,7 +122,6 @@ struct _FrArchivePrivData { gboolean extract_here; }; - typedef struct { FrArchive *archive; char *uri; @@ -144,7 +138,6 @@ typedef struct { guint volume_size; } XferData; - static void xfer_data_free (XferData *data) { @@ -160,14 +153,12 @@ xfer_data_free (XferData *data) g_free (data); } - #define MAX_CHUNK_LEN (NCARGS * 2 / 3) /* Max command line length */ #define NO_BACKUP_FILES (TRUE) #define NO_DOT_FILES (FALSE) #define IGNORE_CASE (FALSE) #define LIST_LENGTH_TO_USE_FILE 10 /* FIXME: find a good value */ - enum { START, DONE, @@ -185,7 +176,6 @@ static void fr_archive_class_init (FrArchiveClass *class); static void fr_archive_init (FrArchive *archive); static void fr_archive_finalize (GObject *object); - GType fr_archive_get_type (void) { @@ -214,7 +204,6 @@ fr_archive_get_type (void) return type; } - static void fr_archive_class_init (FrArchiveClass *class) { @@ -289,7 +278,6 @@ fr_archive_class_init (FrArchiveClass *class) G_TYPE_STRING); } - void fr_archive_stoppable (FrArchive *archive, gboolean stoppable) @@ -300,7 +288,6 @@ fr_archive_stoppable (FrArchive *archive, stoppable); } - void fr_archive_stop (FrArchive *archive) { @@ -313,7 +300,6 @@ fr_archive_stop (FrArchive *archive) g_cancellable_cancel (archive->priv->cancellable); } - void fr_archive_action_completed (FrArchive *archive, FrAction action, @@ -334,7 +320,6 @@ fr_archive_action_completed (FrArchive *archive, &archive->error); } - static gboolean archive_sticky_only_cb (FrProcess *process, FrArchive *archive) @@ -343,7 +328,6 @@ archive_sticky_only_cb (FrProcess *process, return TRUE; } - static void fr_archive_init (FrArchive *archive) { @@ -369,14 +353,12 @@ fr_archive_init (FrArchive *archive) archive); } - FrArchive * fr_archive_new (void) { return FR_ARCHIVE (g_object_new (FR_TYPE_ARCHIVE, NULL)); } - static GFile * get_local_copy_for_file (GFile *remote_file) { @@ -400,7 +382,6 @@ get_local_copy_for_file (GFile *remote_file) return local_copy; } - static void fr_archive_set_uri (FrArchive *archive, const char *uri) @@ -446,7 +427,6 @@ fr_archive_set_uri (FrArchive *archive, archive->local_copy = g_file_dup (archive->file); } - static void fr_archive_remove_temp_work_dir (FrArchive *archive) { @@ -457,7 +437,6 @@ fr_archive_remove_temp_work_dir (FrArchive *archive) archive->priv->temp_dir = NULL; } - static void fr_archive_finalize (GObject *object) { @@ -487,7 +466,6 @@ fr_archive_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } - static const char * get_mime_type_from_content (GFile *file) { @@ -510,7 +488,6 @@ get_mime_type_from_content (GFile *file) return content_type; } - static const char * get_mime_type_from_magic_numbers (GFile *file) { @@ -591,7 +568,6 @@ get_mime_type_from_magic_numbers (GFile *file) return NULL; } - static const char * get_mime_type_from_filename (GFile *file) { @@ -608,7 +584,6 @@ get_mime_type_from_filename (GFile *file) return mime_type; } - static gboolean create_command_from_type (FrArchive *archive, const char *mime_type, @@ -634,7 +609,6 @@ create_command_from_type (FrArchive *archive, return (archive->command != NULL); } - static gboolean create_command_to_load_archive (FrArchive *archive, const char *mime_type) @@ -665,7 +639,6 @@ create_command_to_load_archive (FrArchive *archive, requested_capabilities); } - static gboolean create_command_to_create_archive (FrArchive *archive, const char *mime_type) @@ -685,7 +658,6 @@ create_command_to_create_archive (FrArchive *archive, requested_capabilities); } - static void action_started (FrCommand *command, FrAction action, @@ -701,10 +673,8 @@ action_started (FrCommand *command, action); } - /* -- copy_to_remote_location -- */ - static void fr_archive_copy_done (FrArchive *archive, FrAction action, @@ -720,7 +690,6 @@ fr_archive_copy_done (FrArchive *archive, fr_archive_action_completed (archive, action, error_type, error_details); } - static void copy_to_remote_location_done (GError *error, gpointer user_data) @@ -731,7 +700,6 @@ copy_to_remote_location_done (GError *error, xfer_data_free (xfer_data); } - static void copy_to_remote_location_progress (goffset current_file, goffset total_files, @@ -749,7 +717,6 @@ copy_to_remote_location_progress (goffset current_file, (double) current_num_bytes / total_num_bytes); } - static void copy_to_remote_location (FrArchive *archive, FrAction action) @@ -771,10 +738,8 @@ copy_to_remote_location (FrArchive *archive, xfer_data); } - /* -- copy_extracted_files_to_destination -- */ - static void move_here (FrArchive *archive) { @@ -842,7 +807,6 @@ move_here (FrArchive *archive) g_free (content_uri); } - static void copy_extracted_files_done (GError *error, gpointer user_data) @@ -864,7 +828,6 @@ copy_extracted_files_done (GError *error, fr_archive_copy_done (archive, FR_ACTION_EXTRACTING_FILES, error); } - static void copy_extracted_files_progress (goffset current_file, goffset total_files, @@ -882,7 +845,6 @@ copy_extracted_files_progress (goffset current_file, (double) current_file / (total_files + 1)); } - static void copy_extracted_files_to_destination (FrArchive *archive) { @@ -897,10 +859,8 @@ copy_extracted_files_to_destination (FrArchive *archive) archive); } - static void add_dropped_items (DroppedItemsData *data); - static void fr_archive_change_name (FrArchive *archive, const char *filename) @@ -921,7 +881,6 @@ fr_archive_change_name (FrArchive *archive, g_object_unref (parent); } - static void action_performed (FrCommand *command, FrAction action, @@ -1011,7 +970,6 @@ action_performed (FrCommand *command, error); } - static gboolean archive_progress_cb (FrCommand *command, double fraction, @@ -1024,7 +982,6 @@ archive_progress_cb (FrCommand *command, return TRUE; } - static gboolean archive_message_cb (FrCommand *command, const char *msg, @@ -1037,7 +994,6 @@ archive_message_cb (FrCommand *command, return TRUE; } - static gboolean archive_working_archive_cb (FrCommand *command, const char *archive_filename, @@ -1050,7 +1006,6 @@ archive_working_archive_cb (FrCommand *command, return TRUE; } - static void fr_archive_connect_to_command (FrArchive *archive) { @@ -1076,7 +1031,6 @@ fr_archive_connect_to_command (FrArchive *archive) archive); } - gboolean fr_archive_create (FrArchive *archive, const char *uri) @@ -1108,7 +1062,6 @@ fr_archive_create (FrArchive *archive, return TRUE; } - void fr_archive_set_fake_load_func (FrArchive *archive, FakeLoadFunc func, @@ -1118,7 +1071,6 @@ fr_archive_set_fake_load_func (FrArchive *archive, archive->priv->fake_load_data = data; } - gboolean fr_archive_fake_load (FrArchive *archive) { @@ -1128,10 +1080,8 @@ fr_archive_fake_load (FrArchive *archive) return FALSE; } - /* -- fr_archive_load -- */ - static void load_local_archive (FrArchive *archive, const char *password) @@ -1196,7 +1146,6 @@ load_local_archive (FrArchive *archive, fr_command_list (archive->command); } - static void copy_remote_file_done (GError *error, gpointer user_data) @@ -1210,7 +1159,6 @@ copy_remote_file_done (GError *error, xfer_data_free (xfer_data); } - static void copy_remote_file_progress (goffset current_file, goffset total_files, @@ -1228,7 +1176,6 @@ copy_remote_file_progress (goffset current_file, (double) current_num_bytes / total_num_bytes); } - static gboolean copy_remote_file_done_cb (gpointer user_data) { @@ -1239,7 +1186,6 @@ copy_remote_file_done_cb (gpointer user_data) return FALSE; } - static void copy_remote_file (FrArchive *archive, const char *password) @@ -1278,7 +1224,6 @@ copy_remote_file (FrArchive *archive, xfer_data); } - gboolean fr_archive_load (FrArchive *archive, const char *uri, @@ -1297,7 +1242,6 @@ fr_archive_load (FrArchive *archive, return TRUE; } - gboolean fr_archive_load_local (FrArchive *archive, const char *uri, @@ -1316,7 +1260,6 @@ fr_archive_load_local (FrArchive *archive, return TRUE; } - void fr_archive_reload (FrArchive *archive, const char *password) @@ -1334,10 +1277,8 @@ fr_archive_reload (FrArchive *archive, g_free (uri); } - /* -- add -- */ - static char * create_tmp_base_dir (const char *base_dir, const char *dest_path) @@ -1382,7 +1323,6 @@ create_tmp_base_dir (const char *base_dir, return temp_dir; } - static FileData * find_file_in_archive (FrArchive *archive, char *path) @@ -1398,10 +1338,8 @@ find_file_in_archive (FrArchive *archive, return NULL; } - static void delete_from_archive (FrArchive *archive, GList *file_list); - static GList * newer_files_only (FrArchive *archive, GList *file_list, @@ -1495,7 +1433,6 @@ save_list_to_temp_file (GList *file_list, return ! error_occurred; } - static GList * split_in_chunks (GList *file_list) { @@ -1530,7 +1467,6 @@ split_in_chunks (GList *file_list) return chunks; } - void fr_archive_add (FrArchive *archive, GList *file_list, @@ -1785,7 +1721,6 @@ fr_archive_add (FrArchive *archive, g_free (tmp_base_dir); } - static void fr_archive_add_local_files (FrArchive *archive, GList *file_list, @@ -1811,7 +1746,6 @@ fr_archive_add_local_files (FrArchive *archive, fr_process_start (archive->process); } - static void copy_remote_files_done (GError *error, gpointer user_data) @@ -1833,7 +1767,6 @@ copy_remote_files_done (GError *error, xfer_data_free (xfer_data); } - static void copy_remote_files_progress (goffset current_file, goffset total_files, @@ -1851,7 +1784,6 @@ copy_remote_files_progress (goffset current_file, (double) current_file / (total_files + 1)); } - static void copy_remote_files (FrArchive *archive, GList *file_list, @@ -1940,7 +1872,6 @@ copy_remote_files (FrArchive *archive, gio_file_list_free (destinations); } - static char * fr_archive_get_temp_work_dir (FrArchive *archive) { @@ -1949,7 +1880,6 @@ fr_archive_get_temp_work_dir (FrArchive *archive) return archive->priv->temp_dir; } - void fr_archive_add_files (FrArchive *archive, GList *file_list, @@ -1987,10 +1917,8 @@ fr_archive_add_files (FrArchive *archive, fr_archive_get_temp_work_dir (archive)); } - /* -- add with wildcard -- */ - typedef struct { FrArchive *archive; char *source_dir; @@ -2002,7 +1930,6 @@ typedef struct { guint volume_size; } AddWithWildcardData; - static void add_with_wildcard_data_free (AddWithWildcardData *aww_data) { @@ -2012,7 +1939,6 @@ add_with_wildcard_data_free (AddWithWildcardData *aww_data) g_free (aww_data); } - static void add_with_wildcard__step2 (GList *file_list, GList *dirs_list, @@ -2051,7 +1977,6 @@ add_with_wildcard__step2 (GList *file_list, add_with_wildcard_data_free (aww_data); } - void fr_archive_add_with_wildcard (FrArchive *archive, const char *include_files, @@ -2100,10 +2025,8 @@ fr_archive_add_with_wildcard (FrArchive *archive, aww_data); } - /* -- fr_archive_add_directory -- */ - typedef struct { FrArchive *archive; char *base_dir; @@ -2115,7 +2038,6 @@ typedef struct { guint volume_size; } AddDirectoryData; - static void add_directory_data_free (AddDirectoryData *ad_data) { @@ -2125,7 +2047,6 @@ add_directory_data_free (AddDirectoryData *ad_data) g_free (ad_data); } - static void add_directory__step2 (GList *file_list, GList *dir_list, @@ -2169,7 +2090,6 @@ add_directory__step2 (GList *file_list, add_directory_data_free (ad_data); } - void fr_archive_add_directory (FrArchive *archive, const char *directory, @@ -2209,7 +2129,6 @@ fr_archive_add_directory (FrArchive *archive, ad_data); } - void fr_archive_add_items (FrArchive *archive, GList *item_list, @@ -2248,10 +2167,8 @@ fr_archive_add_items (FrArchive *archive, ad_data); } - /* -- fr_archive_add_dropped_items -- */ - static gboolean all_files_in_same_dir (GList *list) { @@ -2288,7 +2205,6 @@ all_files_in_same_dir (GList *list) return same_dir; } - static void add_dropped_items (DroppedItemsData *data) { @@ -2427,7 +2343,6 @@ add_dropped_items (DroppedItemsData *data) data->item_list = NULL; } - void fr_archive_add_dropped_items (FrArchive *archive, GList *item_list, @@ -2479,10 +2394,8 @@ fr_archive_add_dropped_items (FrArchive *archive, add_dropped_items (archive->priv->dropped_items_data); } - /* -- remove -- */ - static gboolean file_is_in_subfolder_of (const char *filename, GList *folder_list) @@ -2508,7 +2421,6 @@ archive_type_has_issues_deleting_non_empty_folders (FrArchive *archive) return ! archive->command->propCanDeleteNonEmptyFolders; } - static void delete_from_archive (FrArchive *archive, GList *file_list) @@ -2616,7 +2528,6 @@ delete_from_archive (FrArchive *archive, g_list_free (tmp_file_list); } - void fr_archive_remove (FrArchive *archive, GList *file_list, @@ -2698,10 +2609,8 @@ fr_archive_remove (FrArchive *archive, g_free (tmp_archive_dir); } - /* -- extract -- */ - static void move_files_to_dir (FrArchive *archive, GList *file_list, @@ -2773,7 +2682,6 @@ move_files_to_dir (FrArchive *archive, g_list_free (list); } - static void move_files_in_chunks (FrArchive *archive, GList *file_list, @@ -2808,7 +2716,6 @@ move_files_in_chunks (FrArchive *archive, } } - static void extract_from_archive (FrArchive *archive, GList *file_list, @@ -2892,7 +2799,6 @@ extract_from_archive (FrArchive *archive, } } - static char* compute_base_path (const char *base_dir, const char *path, @@ -2936,7 +2842,6 @@ compute_base_path (const char *base_dir, return new_path; } - static GList* compute_list_base_path (const char *base_dir, GList *filtered, @@ -2983,7 +2888,6 @@ compute_list_base_path (const char *base_dir, return list_unique; } - static gboolean archive_type_has_issues_extracting_non_empty_folders (FrArchive *archive) { @@ -2992,7 +2896,6 @@ archive_type_has_issues_extracting_non_empty_folders (FrArchive *archive) return ! archive->command->propCanExtractNonEmptyFolders; } - static gboolean file_list_contains_files_in_this_dir (GList *file_list, const char *dirname) @@ -3009,7 +2912,6 @@ file_list_contains_files_in_this_dir (GList *file_list, return FALSE; } - static GList* remove_files_contained_in_this_dir (GList *file_list, GList *dir_pointer) @@ -3039,7 +2941,6 @@ remove_files_contained_in_this_dir (GList *file_list, return file_list; } - void fr_archive_extract_to_local (FrArchive *archive, GList *file_list, @@ -3246,7 +3147,6 @@ fr_archive_extract_to_local (FrArchive *archive, path_list_free (file_list); } - void fr_archive_extract (FrArchive *archive, GList *file_list, @@ -3291,7 +3191,6 @@ fr_archive_extract (FrArchive *archive, } } - static char * get_desired_destination_for_archive (GFile *file) { @@ -3327,7 +3226,6 @@ get_desired_destination_for_archive (GFile *file) return desired_destination; } - static char * get_extract_here_destination (GFile *file, GError **error) @@ -3366,7 +3264,6 @@ get_extract_here_destination (GFile *file, return destination; } - gboolean fr_archive_extract_here (FrArchive *archive, gboolean skip_older, @@ -3402,14 +3299,12 @@ fr_archive_extract_here (FrArchive *archive, return TRUE; } - const char * fr_archive_get_last_extraction_destination (FrArchive *archive) { return archive->priv->extraction_destination; } - void fr_archive_test (FrArchive *archive, const char *password) @@ -3426,7 +3321,6 @@ fr_archive_test (FrArchive *archive, fr_process_start (archive->process); } - gboolean uri_is_archive (const char *uri) { |