/*########################### save_button() #############################*/ void save_button(Widget w, XtPointer client_data, XtPointer call_data) { write_info_file(info_w, host_name, HOST_INFO_FILE); return; }
void vifm_try_leave(int write_info, int cquit, int force) { if(!force && bg_has_active_jobs()) { if(!prompt_msg("Warning", "Some of backgrounded commands are still " "working. Quit?")) { return; } } fuse_unmount_all(); if(write_info) { write_info_file(); } if(stats_file_choose_action_set()) { vim_write_empty_file_list(); } #ifdef _WIN32 erase(); refresh(); #endif ui_shutdown(); vifm_leave(EXIT_SUCCESS, cquit); }
static void _gnuc_noreturn shutdown_nicely(void) { LOG_FUNC_ENTER; endwin(); set_term_title(NULL); unmount_fuse(); write_info_file(); fprintf(stdout, "Vifm killed by signal.\n"); exit(0); }
static void _gnuc_noreturn shutdown_nicely(int sig, const char descr[]) { LOG_FUNC_ENTER; endwin(); term_title_update(NULL); fuse_unmount_all(); write_info_file(); fprintf(stdout, "Vifm killed by signal: %d (%s).\n", sig, descr); /* Alternatively we could do this sequence: * signal(sig, SIG_DFL); * raise(sig); * but only on *nix systems. */ _Exit(EXIT_FAILURE); }
void _gnuc_noreturn vifm_finish(const char message[]) { ui_shutdown(); /* Update vifminfo only if we were able to startup, otherwise we can end up * writing from some intermediate half-initialized state. One particular * case: after vifminfo read, but before configuration is processed, as a * result we write very little information to vifminfo file according to * default value of 'vifminfo' option. */ if(curr_stats.load_stage == 3) { write_info_file(); } fprintf(stderr, "%s\n", message); LOG_ERROR_MSG("Finishing: %s", message); vifm_exit(EXIT_FAILURE); }
void _gnuc_noreturn vifm_choose_files(const view_t *view, int nfiles, char *files[]) { int exit_code; /* As curses can do something with terminal on shutting down, disable it * before writing anything to the screen. */ ui_shutdown(); exit_code = EXIT_SUCCESS; if(vim_write_file_list(view, nfiles, files) != 0) { exit_code = EXIT_FAILURE; } /* XXX: this ignores nfiles+files. */ if(vim_run_choose_cmd(view) != 0) { exit_code = EXIT_FAILURE; } write_info_file(); vifm_leave(exit_code, 0); }