summaryrefslogtreecommitdiffstats
path: root/lib/keystroke.h
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-04-06 02:10:30 +0100
committerChris Hall <GMCH@hestia.halldom.com>2010-04-06 02:10:30 +0100
commit8fea5ca7104c0d95108947661a4991b61b2ee06e (patch)
tree7ad44a658a61d4a8dfb43ca5b6122c5626f68ea0 /lib/keystroke.h
parentc933cf7233f51f677ab01689f175ceb3dc5361f6 (diff)
downloadquagga-8fea5ca7104c0d95108947661a4991b61b2ee06e.tar.bz2
quagga-8fea5ca7104c0d95108947661a4991b61b2ee06e.tar.xz
First beta release
Various bug fixes and improvements. Running with a fair amount of debug/assert code, which must be removed at some date.
Diffstat (limited to 'lib/keystroke.h')
-rw-r--r--lib/keystroke.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/keystroke.h b/lib/keystroke.h
index 4dc94d12..2b1d4d93 100644
--- a/lib/keystroke.h
+++ b/lib/keystroke.h
@@ -64,11 +64,14 @@ enum keystroke_null
enum keystroke_flags
{
kf_compound = 0x80, /* marker on all compound characters */
+
kf_reserved = 0x40,
kf_broken = 0x20, /* badly formed in some way */
kf_truncated = 0x10, /* too big for buffer ! */
/* for ks_null => EOF */
+ kf_flag_mask = 0x70, /* flags for the keystroke */
+
kf_type_mask = 0x0F, /* extraction of type */
} ;
@@ -80,7 +83,7 @@ typedef struct keystroke_stream* keystroke_stream ;
struct keystroke
{
enum keystroke_type type ;
- uint8_t flags ;
+ uint8_t flags ; /* the kf_flag_mask flags */
uint32_t value ;
@@ -88,6 +91,9 @@ struct keystroke
uint8_t buf[keystroke_max_len] ;
} ;
+#define keystroke_iac_callback_args void* context, keystroke stroke
+typedef bool (keystroke_callback)(keystroke_iac_callback_args) ;
+
/* Telnet commands/options */
enum tn_Command
{
@@ -165,12 +171,13 @@ enum tn_Option
* Functions
*/
extern keystroke_stream
-keystroke_stream_new(uint8_t csi_char) ;
+keystroke_stream_new(uint8_t csi_char, keystroke_callback* iac_callback,
+ void* iac_callback_context) ;
extern void
keystroke_stream_set_eof(keystroke_stream stream) ;
-extern void
+extern keystroke_stream
keystroke_stream_free(keystroke_stream stream) ;
extern bool