aboutsummaryrefslogtreecommitdiffhomepage
path: root/input_common.h
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-09-20 23:26:39 +1000
committerGravatar axel <axel@liljencrantz.se>2005-09-20 23:26:39 +1000
commit149594f974350bb364a76c73b91b1d5ffddaa1fa (patch)
tree95650e9982d5fabe4bd805d94c5d700cbbc1ca7f /input_common.h
Initial revision
darcs-hash:20050920132639-ac50b-fa3b476891e1f5f67207cf4cc7bf623834cc5edc.gz
Diffstat (limited to 'input_common.h')
-rw-r--r--input_common.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/input_common.h b/input_common.h
new file mode 100644
index 00000000..ad4f862f
--- /dev/null
+++ b/input_common.h
@@ -0,0 +1,40 @@
+/** \file input_common.h
+
+Header file for the low level input library
+
+*/
+#ifndef INPUT_COMMON_HH
+#define INPUT_COMMON_HH
+
+/**
+ Hopefully, the biggest value that a wchar_t can have. UCS4 is a
+ 31-bit character set, we use the upper half for special key
+ sequences. On systems where wchar_t is not a 31 (or less) bit character set
+ in a 32 (or more) bit type this will fail horribly.
+*/
+#define WCHAR_END 0x80000000
+
+enum
+{
+ R_NULL = WCHAR_END + 1
+}
+ ;
+
+void input_common_init( int (*ih)() );
+
+void input_common_destroy();
+
+/**
+ Function used by input_readch to read bytes from stdin until enough
+ bytes have been read to convert them to a wchar_t. Conversion is
+ done using mbrtowc. If a character has previously been read and
+ then 'unread' using \c input_common_unreadch, that character is
+ returned. If timed is true, readch2 will wait at most
+ WAIT_ON_ESCAPE milliseconds for a character to be available for
+ reading before returning with the value WEOF.
+*/
+wchar_t input_common_readch( int timed );
+
+void input_common_unreadch( wint_t ch );
+
+#endif