Lines Matching refs:archive

42 XArchive *archive[MAX_XARCHIVES];  variable
44 static gboolean xa_process_stdout (GIOChannel *ioc, GIOCondition cond, XArchive *archive) in xa_process_stdout() argument
58 archive->output = g_slist_prepend(archive->output, g_strdup(line)); in xa_process_stdout()
61 if (archive->parse_output) in xa_process_stdout()
62 (*archive->parse_output)(line, archive); in xa_process_stdout()
80 xa_child_processed(XA_CHILD_STDOUT, cond == G_IO_HUP, archive); in xa_process_stdout()
85 static gboolean xa_process_stderr (GIOChannel *ioc, GIOCondition cond, XArchive *archive) in xa_process_stderr() argument
109 archive->output = g_slist_prepend(archive->output, g_strdup(line)); in xa_process_stderr()
125 xa_child_processed(XA_CHILD_STDERR, cond == G_IO_HUP, archive); in xa_process_stderr()
130 static void xa_process_exit (GPid pid, gint status, XArchive *archive) in xa_process_exit() argument
136 result = (WEXITSTATUS(status) == 0 || (archive->status == XARCHIVESTATUS_RELOAD && in xa_process_exit()
137 !g_file_test(archive->path[0], G_FILE_TEST_EXISTS))); in xa_process_exit()
139 xa_child_processed(XA_CHILD_EXIT, result, archive); in xa_process_exit()
143 static void xa_delete_working_directory (XArchive *archive) in xa_delete_working_directory() argument
146 xa_launch_external_program("rm -rf", archive->working_dir); in xa_delete_working_directory()
152 argv[2] = archive->working_dir; in xa_delete_working_directory()
208 static gpointer *xa_fill_archive_entry_columns_for_each_row (XArchive *archive, XEntry *entry, gpoi… in xa_fill_archive_entry_columns_for_each_row() argument
215 for (i = 2; i < archive->columns - 1; i++) in xa_fill_archive_entry_columns_for_each_row()
217 switch(archive->column_types[i]) in xa_fill_archive_entry_columns_for_each_row()
339 XArchive *archive; in xa_init_archive_structure() local
342 archive = g_new0(XArchive, 1); in xa_init_archive_structure()
344 if (!archive) in xa_init_archive_structure()
347 archive->type = xa.type; in xa_init_archive_structure()
348 archive->tag = xa.tag; in xa_init_archive_structure()
354 g_free(archive); in xa_init_archive_structure()
359 archive->root_entry = entry; in xa_init_archive_structure()
361 archive->archiver = &archiver[xa.type]; in xa_init_archive_structure()
366 (*archive->archiver->ask)(archive); in xa_init_archive_structure()
368 return archive; in xa_init_archive_structure()
371 void xa_spawn_async_process (XArchive *archive, const gchar *command) in xa_spawn_async_process() argument
380 if (!g_spawn_async_with_pipes(archive->child_dir, in xa_spawn_async_process()
386 &archive->child_pid, in xa_spawn_async_process()
388 &archive->child_fdout, in xa_spawn_async_process()
389 &archive->child_fderr, in xa_spawn_async_process()
398 …, 1, archive->can_test, 1, archive->can_add, archive->can_extract, archive->sorted, archive->can_s… in xa_spawn_async_process()
400 archive->status = XARCHIVESTATUS_ERROR; in xa_spawn_async_process()
406 g_free(archive->command); in xa_spawn_async_process()
407 archive->command = g_strdup(command); in xa_spawn_async_process()
409 archive->child_ref = XA_CHILD_PROCS; in xa_spawn_async_process()
414 g_timeout_add(350, (GSourceFunc) xa_flash_led_indicator, archive); in xa_spawn_async_process()
419 if (archive->output) in xa_spawn_async_process()
421 g_slist_free_full(archive->output, g_free); in xa_spawn_async_process()
422 archive->output = NULL; in xa_spawn_async_process()
425 ioc = g_io_channel_unix_new(archive->child_fdout); in xa_spawn_async_process()
428 …io_add_watch(ioc, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, (GIOFunc) xa_process_stdout, archive); in xa_spawn_async_process()
430 ioc = g_io_channel_unix_new(archive->child_fderr); in xa_spawn_async_process()
433 …io_add_watch(ioc, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, (GIOFunc) xa_process_stderr, archive); in xa_spawn_async_process()
435 if (archive->parse_output) in xa_spawn_async_process()
436 …g_child_watch_add_full(G_PRIORITY_LOW, archive->child_pid, (GChildWatchFunc) xa_process_exit, arch… in xa_spawn_async_process()
464 void xa_clean_archive_structure (XArchive *archive) in xa_clean_archive_structure() argument
466 xa_free_entry(archive, archive->root_entry); in xa_clean_archive_structure()
468 if (archive->working_dir) in xa_clean_archive_structure()
470 xa_delete_working_directory(archive); in xa_clean_archive_structure()
471 g_free(archive->working_dir); in xa_clean_archive_structure()
474 if (archive->comment) in xa_clean_archive_structure()
475 g_string_free(archive->comment, TRUE); in xa_clean_archive_structure()
477 if (archive->output) in xa_clean_archive_structure()
478 g_slist_free_full(archive->output, g_free); in xa_clean_archive_structure()
480 if (archive->clipboard) in xa_clean_archive_structure()
481 xa_clipboard_clear(NULL, archive); in xa_clean_archive_structure()
483 g_free(archive->column_types); in xa_clean_archive_structure()
484 g_free(archive->path[0]); in xa_clean_archive_structure()
485 g_free(archive->path[1]); in xa_clean_archive_structure()
486 g_free(archive->path[2]); in xa_clean_archive_structure()
487 g_free(archive->destination_path); in xa_clean_archive_structure()
488 g_free(archive->extraction_dir); in xa_clean_archive_structure()
489 g_free(archive->password); in xa_clean_archive_structure()
490 g_free(archive->child_dir); in xa_clean_archive_structure()
491 g_free(archive->command); in xa_clean_archive_structure()
492 g_free(archive); in xa_clean_archive_structure()
495 gboolean xa_create_working_directory (XArchive *archive) in xa_create_working_directory() argument
500 if (archive->working_dir != NULL) in xa_create_working_directory()
525 archive->working_dir = tmp_dir; in xa_create_working_directory()
529 gchar *xa_create_containing_directory (XArchive *archive, const gchar *path) in xa_create_containing_directory() argument
535 stem = g_path_get_basename(archive->path[0]); in xa_create_containing_directory()
573 gboolean xa_run_command (XArchive *archive, const gchar *command) in xa_run_command() argument
580 if (!xa_main_window && archive->column_types) in xa_run_command()
581 xa_show_progress_bar(archive); in xa_run_command()
583 xa_spawn_async_process(archive, command); in xa_run_command()
585 if (archive->child_pid == 0) in xa_run_command()
589 while (pid != archive->child_pid && pid != -1) in xa_run_command()
591 pid = waitpid(archive->child_pid, &status, WNOHANG); in xa_run_command()
600 xa_child_processed(XA_CHILD_EXIT, result, archive); in xa_run_command()
605 gboolean xa_has_containing_directory (XArchive *archive) in xa_has_containing_directory() argument
610 entry = archive->root_entry->child; in xa_has_containing_directory()
619 return (n == 1) && archive->root_entry->child->is_dir; in xa_has_containing_directory()
631 if (archive[i] != NULL && archive[i]->page == page) in xa_find_archive_index()
644 if (archive[i] == NULL) in xa_get_new_archive_idx()
650 void xa_free_entry (XArchive *archive, XEntry *entry) in xa_free_entry() argument
656 xa_free_entry(archive, entry->child); in xa_free_entry()
659 xa_free_entry(archive, entry->next); in xa_free_entry()
667 for (i = 2; i < archive->columns - 1; i++) in xa_free_entry()
669 switch (archive->column_types[i]) in xa_free_entry()
690 XEntry *xa_set_archive_entries_for_each_row (XArchive *archive, const gchar *filename, gpointer *it… in xa_set_archive_entries_for_each_row() argument
692 XEntry *entry = NULL, *last = archive->root_entry; in xa_set_archive_entries_for_each_row()
714 entry = xa_alloc_memory_for_each_row(archive->columns, archive->column_types); in xa_set_archive_entries_for_each_row()
730 entry->columns = xa_fill_archive_entry_columns_for_each_row(archive, entry, items); in xa_set_archive_entries_for_each_row()
741 XEntry* xa_find_entry_from_dirpath (XArchive *archive, const gchar *dirpath) in xa_find_entry_from_dirpath() argument
743 XEntry *root = archive->root_entry, *entry = NULL; in xa_find_entry_from_dirpath()
798 void xa_detect_encrypted_archive (XArchive *archive) in xa_detect_encrypted_archive() argument
800 archive->status = XARCHIVESTATUS_LIST; in xa_detect_encrypted_archive()
801 (*archive->archiver->list)(archive); in xa_detect_encrypted_archive()
808 while (archive->child_ref); in xa_detect_encrypted_archive()
811 void xa_fill_dir_sidebar(XArchive *archive,gboolean force_reload) in xa_fill_dir_sidebar() argument
819 xa_build_dir_sidebar(archive->root_entry, archive_dir_treestore, NULL, NULL); in xa_fill_dir_sidebar()
857 xa_update_window_with_archive_entries(archive[idx],entry); in xa_dir_sidebar_row_selected()
858 xa_set_statusbar_message_for_displayed_rows(archive[idx]); in xa_dir_sidebar_row_selected()
867 … xa_sort_dirs_before_files (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, XArchive *archive) in xa_sort_dirs_before_files() argument
871 gtk_tree_model_get(model, a, archive->columns - 1, &entry1, -1); in xa_sort_dirs_before_files()
872 gtk_tree_model_get(model, b, archive->columns - 1, &entry2, -1); in xa_sort_dirs_before_files()