summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko2008-10-25 23:23:00 +0000
committerDenis Vlasenko2008-10-25 23:23:00 +0000
commit0112ff5203e1bbc37425b87a71326aa0a85ec283 (patch)
tree93d798f5a0611f77e6eb9983368710875be334a3 /include
parent73d702ee07347f5cf82175c28a12bdd8d297251f (diff)
downloadbusybox-0112ff5203e1bbc37425b87a71326aa0a85ec283.zip
busybox-0112ff5203e1bbc37425b87a71326aa0a85ec283.tar.gz
vi: move key reading routine out of vi into llbbb
function old new delta read_key - 310 +310 .... static.esccmds 170 61 -109 readit 286 60 -226 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 9/10 up/down: 349/-367) Total: -18 bytes
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 5b92574..9317109 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -921,6 +921,39 @@ void bb_displayroutes(int noresolve, int netstatfmt) FAST_FUNC;
#endif
+/* "Keycodes" that report an escape sequence.
+ * We use something which fits into signed char,
+ * yet doesn't represent any valid Unicode characher.
+ * Also, -1 is reserved for error indication and we don't use it. */
+enum {
+ KEYCODE_UP = -2,
+ KEYCODE_DOWN = -3,
+ KEYCODE_RIGHT = -4,
+ KEYCODE_LEFT = -5,
+ KEYCODE_HOME = -6,
+ KEYCODE_END = -7,
+ KEYCODE_INSERT = -8,
+ KEYCODE_DELETE = -9,
+ KEYCODE_PAGEUP = -10,
+ KEYCODE_PAGEDOWN = -11,
+#if 0
+ KEYCODE_FUN1 = -12,
+ KEYCODE_FUN2 = -13,
+ KEYCODE_FUN3 = -14,
+ KEYCODE_FUN4 = -15,
+ KEYCODE_FUN5 = -16,
+ KEYCODE_FUN6 = -17,
+ KEYCODE_FUN7 = -18,
+ KEYCODE_FUN8 = -19,
+ KEYCODE_FUN9 = -20,
+ KEYCODE_FUN10 = -21,
+ KEYCODE_FUN11 = -22,
+ KEYCODE_FUN12 = -23,
+#endif
+};
+int read_key(int fd, smalluint *nbuffered, char *buffer) FAST_FUNC;
+
+
/* Networking */
int create_icmp_socket(void) FAST_FUNC;
int create_icmp6_socket(void) FAST_FUNC;