/* * NAME: cmdbuf->wq() * DESCRIPTION: write a range of lines to a file and quit */ int cb_wq(cmdbuf *cb) { cb->first = 1; cb->last = cb->edbuf->lines; cb_write(cb); return cb_quit(cb); }
static void cb_import(GtkWidget *widget, gpointer filesel) { const char *sel; struct stat statb; jp_logf(JP_LOG_DEBUG, "cb_import\n"); sel = gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); jp_logf(JP_LOG_DEBUG, "file selected [%s]\n", sel); /* Check to see if its a regular file */ if (stat(sel, &statb)) { jp_logf(JP_LOG_DEBUG, "File selected was not stat-able\n"); return; } if (!S_ISREG(statb.st_mode)) { jp_logf(JP_LOG_DEBUG, "File selected was not a regular file\n"); return; } glob_import_callback(filesel, sel, glob_type_selected); cb_quit(widget, filew); }