commit - 98b6dee90d3fd7300cc834972decd2c123af999c
commit + 693188cbff678ee0934f5fe5da91365614864888
blob - 5662481216175398fd6fab6157e02e1886a1b674
blob + 473b28c04befb9e50c13079a38f6d0453493302c
--- telescope.c
+++ telescope.c
load_page_from_str(tab, err_pages[tab->code]);
} else if (tab->code < 20) { /* 1x */
load_page_from_str(tab, err_pages[tab->code]);
- ui_require_input(tab, tab->code == 11, PROTO_GEMINI);
+ ui_require_input(tab, tab->code == 11, ir_select_gemini);
} else if (tab->code == 20) {
if (setup_parser_for(tab)) {
ui_send_net(IMSG_PROCEED, tab->id, NULL, 0);
parser_init(tab, gophermap_initparser);
break;
case '7':
- ui_require_input(tab, 0, PROTO_GOPHER);
+ ui_require_input(tab, 0, ir_select_gopher);
return load_page_from_str(tab, err_pages[10]);
default:
return load_page_from_str(tab, "Unknown gopher selector");
blob - ea9e15f47d366cdbcbcd3288ee9124aeb1f67d58
blob + f33ac6e2ff2d8ffd5124950f2834896f3c0b6478
--- ui.c
+++ ui.c
}
void
-ui_require_input(struct tab *tab, int hide, int proto)
+ui_require_input(struct tab *tab, int hide, void (*fn)(void))
{
- void (*fn)(void);
-
- if (proto == PROTO_GEMINI)
- fn = ir_select_gemini;
- else if (proto == PROTO_GOPHER)
- fn = ir_select_gopher;
- else
- abort();
-
/* TODO: hard-switching to another tab is ugly */
switch_to_tab(tab);
blob - b6e87ce4f0479d0e29d024e4e875df0e36469954
blob + fc246f83cadcb8f31f2b8a7fb2de68b04cd61937
--- ui.h
+++ ui.h
void ui_show_downloads_pane(void);
void ui_schedule_redraw(void);
void ui_after_message_hook(void);
-void ui_require_input(struct tab *, int, int);
+void ui_require_input(struct tab *, int, void (*)(void));
void ui_yornp(const char *, void (*)(int, struct tab *), struct tab *);
void ui_read(const char *, void (*)(const char *, struct tab *), struct tab *, const char *);
void ui_other_window(void);