summaryrefslogtreecommitdiff
path: root/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2015-11-10 09:00:41 -0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-11-11 21:38:48 +0100
commit4f85a1eb76d1e7109bcc60ba6f3262a5654ac61b (patch)
treee996818c6aa6b6f702a6c805c447c20724eff265 /payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c
parent2ea24dabd658b8396e0abf79318a538ef0f3a5b8 (diff)
libpayload: Rename PDCurses-3.4 to PDCurses
Change-Id: If881ec130833c7e7e62caa3d31e350a531f5bc8e Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/12398 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c')
-rw-r--r--payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c102
1 files changed, 0 insertions, 102 deletions
diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c
deleted file mode 100644
index 2f85ba062d..0000000000
--- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Public Domain Curses */
-
-#include "pdcx11.h"
-
-RCSID("$Id: pdckbd.c,v 1.62 2008/07/14 04:24:52 wmcbrine Exp $")
-
-/*man-start**************************************************************
-
- Name: pdckbd
-
- Synopsis:
- unsigned long PDC_get_input_fd(void);
-
- Description:
- PDC_get_input_fd() returns the file descriptor that PDCurses
- reads its input from. It can be used for select().
-
- Portability X/Open BSD SYS V
- PDC_get_input_fd - - -
-
-**man-end****************************************************************/
-
-/* check if a key or mouse event is waiting */
-
-bool PDC_check_key(void)
-{
- struct timeval socket_timeout = {0};
- int s;
-
- /* Is something ready to be read on the socket ? Must be a key. */
-
- FD_ZERO(&xc_readfds);
- FD_SET(xc_key_sock, &xc_readfds);
-
- if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL,
- NULL, &socket_timeout)) < 0)
- XCursesExitCursesProcess(3, "child - exiting from "
- "PDC_check_key select failed");
-
- PDC_LOG(("%s:PDC_check_key() - returning %s\n", XCLOGMSG,
- s ? "TRUE" : "FALSE"));
-
- return !!s;
-}
-
-/* return the next available key or mouse event */
-
-int PDC_get_key(void)
-{
- unsigned long newkey = 0;
- int key = 0;
-
- if (XC_read_socket(xc_key_sock, &newkey, sizeof(unsigned long)) < 0)
- XCursesExitCursesProcess(2, "exiting from PDC_get_key");
-
- pdc_key_modifiers = (newkey >> 24) & 0xFF;
- key = (int)(newkey & 0x00FFFFFF);
-
- if (key == KEY_MOUSE && SP->key_code)
- {
- if (XC_read_socket(xc_key_sock, &pdc_mouse_status,
- sizeof(MOUSE_STATUS)) < 0)
- XCursesExitCursesProcess(2, "exiting from PDC_get_key");
- }
-
- PDC_LOG(("%s:PDC_get_key() - key %d returned\n", XCLOGMSG, key));
-
- return key;
-}
-
-unsigned long PDC_get_input_fd(void)
-{
- PDC_LOG(("PDC_get_input_fd() - called\n"));
-
- return xc_key_sock;
-}
-
-void PDC_set_keyboard_binary(bool on)
-{
- PDC_LOG(("PDC_set_keyboard_binary() - called\n"));
-}
-
-/* discard any pending keyboard or mouse input -- this is the core
- routine for flushinp() */
-
-void PDC_flushinp(void)
-{
- PDC_LOG(("PDC_flushinp() - called\n"));
-
- while (PDC_check_key())
- PDC_get_key();
-}
-
-int PDC_mouse_set(void)
-{
- return OK;
-}
-
-int PDC_modifiers_set(void)
-{
- return OK;
-}