From 62e8aa21abca6ff635268aa8723443b973354a14 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Oct 2008 14:32:29 +0200 Subject: [PATCH] removed my_wgetch(), switch to wgetch() There are no special cases left for my_wgetch() to handle. We can remove it and use the original wgetch() instead. --- src/command.c | 12 +----------- src/command.h | 1 - src/screen.c | 2 -- src/screen_utils.c | 2 +- src/wreadln.c | 6 +----- src/wreadln.h | 4 ---- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/command.c b/src/command.c index b18a98b..fa7fe2e 100644 --- a/src/command.c +++ b/src/command.c @@ -391,22 +391,12 @@ get_key_command(int key) return find_key_command(key, cmds); } -int -my_wgetch(WINDOW *w) -{ - int c; - - c = wgetch(w); - - return c; -} - command_t get_keyboard_command(void) { int key; - key = my_wgetch(stdscr); + key = wgetch(stdscr); if (key == ERR) return CMD_NONE; diff --git a/src/command.h b/src/command.h index 4529da8..63d83b0 100644 --- a/src/command.h +++ b/src/command.h @@ -97,7 +97,6 @@ command_t get_key_command(int key); command_t get_key_command_from_name(char *name); int assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]); -int my_wgetch(WINDOW *w); command_t get_keyboard_command(void); #endif diff --git a/src/screen.c b/src/screen.c index 7035ae0..aed9d9a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -25,7 +25,6 @@ #include "charset.h" #include "mpdclient.h" #include "utils.h" -#include "command.h" #include "options.h" #include "colors.h" #include "strfsong.h" @@ -525,7 +524,6 @@ screen_init(mpdclient_t *c) mode_fn->open(c); /* initialize wreadln */ - wrln_wgetch = my_wgetch; wrln_max_history_length = 16; } diff --git a/src/screen_utils.c b/src/screen_utils.c index e42de0b..fc8fa90 100644 --- a/src/screen_utils.c +++ b/src/screen_utils.c @@ -54,7 +54,7 @@ screen_getch(WINDOW *w, const char *prompt) echo(); curs_set(1); - while ((key=my_wgetch(w)) == ERR) + while ((key = wgetch(w)) == ERR) ; #ifdef HAVE_GETMOUSE diff --git a/src/wreadln.c b/src/wreadln.c index 42b5561..7f00ef3 100644 --- a/src/wreadln.c +++ b/src/wreadln.c @@ -44,7 +44,6 @@ guint wrln_max_line_size = WRLN_MAX_LINE_SIZE; guint wrln_max_history_length = WRLN_MAX_HISTORY_LENGTH; -wrln_wgetch_fn_t wrln_wgetch = NULL; void *wrln_completion_callback_data = NULL; wrln_gcmp_pre_cb_t wrln_pre_completion_callback = NULL; wrln_gcmp_post_cb_t wrln_post_completion_callback = NULL; @@ -182,10 +181,7 @@ _wreadln(WINDOW *w, } while( key!=13 && key!='\n' ) { - if( wrln_wgetch ) - key = wrln_wgetch(w); - else - key = wgetch(w); + key = wgetch(w); /* check if key is a function key */ for(i=0; i<63; i++) diff --git a/src/wreadln.h b/src/wreadln.h index 9ce6ae4..fa52d49 100644 --- a/src/wreadln.h +++ b/src/wreadln.h @@ -10,10 +10,6 @@ extern guint wrln_max_line_size; /* max items stored in the history list */ extern guint wrln_max_history_length; -/* custom wgetch function */ -typedef int (*wrln_wgetch_fn_t) (WINDOW *w); -extern wrln_wgetch_fn_t wrln_wgetch; - /* completion callback data */ extern void *wrln_completion_callback_data; -- 2.30.2