commit 7f963c410faa911376fc67144d2ca817d7cfeae8 from: Omar Polo date: Sun Jun 20 20:51:20 2021 UTC kill ui_notify and export {v,}message commit - 2b2d2872b6aacc66cdcc7af08ab684c12616c33d commit + 7f963c410faa911376fc67144d2ca817d7cfeae8 blob - 13a09a1ddd29c5bb8469aca4f7fe0280cf245ddd blob + b2b5ba11415b0529872c05bb984076dcc8674f38 --- cmd.c +++ cmd.c @@ -19,8 +19,6 @@ #include "telescope.h" #include "cmd.gen.h" - -#define message ui_notify void cmd_previous_line(struct buffer *buffer) blob - a18a392efaceabe18fa5d414c9d28b25a932ddd3 blob + 8f703a8004b5c1182a58ab48dc598b2fab8dc327 --- telescope.c +++ telescope.c @@ -406,9 +406,9 @@ handle_imsg_bookmark_ok(struct imsg *imsg, size_t data memcpy(&res, imsg->data, sizeof(res)); if (res == 0) - ui_notify("Added to bookmarks!"); + message("Added to bookmarks!"); else - ui_notify("Failed to add to bookmarks: %s", + message("Failed to add to bookmarks: %s", strerror(res)); } @@ -421,7 +421,7 @@ handle_imsg_save_cert_ok(struct imsg *imsg, size_t dat die(); memcpy(&res, imsg->data, datalen); if (res != 0) - ui_notify("Failed to save the cert for: %s", + message("Failed to save the cert for: %s", strerror(res)); } @@ -434,7 +434,7 @@ handle_imsg_update_cert_ok(struct imsg *imsg, size_t d die(); memcpy(&res, imsg->data, datalen); if (!res) - ui_notify("Failed to update the certificate"); + message("Failed to update the certificate"); } static void blob - f6f9fc1db5be5a52a95bb4725e7ba43ed15fd45f blob + b2fda67e5ed87f070bdd5c087176db0c911d9125 --- telescope.h +++ telescope.h @@ -361,6 +361,8 @@ void ir_select(void); void lu_self_insert(void); void lu_select(void); void bp_select(void); +void vmessage(const char*, va_list); +void message(const char*, ...) __attribute__((format(printf, 1, 2))); void start_loading_anim(struct tab *tab); void load_url_in_tab(struct tab *, const char *); void enter_minibuffer(void(*)(void), void(*)(void), void(*)(void), struct histhead *); @@ -378,7 +380,6 @@ void ui_schedule_redraw(void); void ui_require_input(struct tab*, int); void ui_read(const char*, void(*)(const char*, unsigned int), unsigned int); void ui_yornp(const char*, void (*)(int, unsigned int), unsigned int); -void ui_notify(const char*, ...) __attribute__((format(printf, 1, 2))); void ui_end(void); /* utf.8 */ blob - 867e350f864d47b60e15ec7ac4d51321c54c334a blob + 090f91e96b4d0ed0c5f340ab971aa688af5a4ad0 --- ui.c +++ ui.c @@ -78,8 +78,6 @@ static void redraw_tab(struct tab*); static void emit_help_item(char*, void*); static void rec_compute_help(struct kmap*, char*, size_t); static void recompute_help(void); -static void vmessage(const char*, va_list); -static void message(const char*, ...) __attribute__((format(printf, 1, 2))); static void update_loading_anim(int, short, void*); static void stop_loading_anim(struct tab*); static void session_new_tab_cb(const char*); @@ -1110,7 +1108,7 @@ recompute_help(void) wrap_page(&helpwin, help_cols); } -static void +void vmessage(const char *fmt, va_list ap) { if (evtimer_pending(&clminibufev, NULL)) @@ -1138,7 +1136,7 @@ vmessage(const char *fmt, va_list ap) } } -static void +void message(const char *fmt, ...) { va_list ap; @@ -1503,16 +1501,6 @@ ui_read(const char *prompt, void (*fn)(const char*, un strlcpy(ministate.prompt, prompt, len); strlcat(ministate.prompt, ": ", len); redraw_tab(current_tab()); -} - -void -ui_notify(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vmessage(fmt, ap); - va_end(ap); } void