diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-04-06 02:10:30 +0100 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-04-06 02:10:30 +0100 |
commit | 8fea5ca7104c0d95108947661a4991b61b2ee06e (patch) | |
tree | 7ad44a658a61d4a8dfb43ca5b6122c5626f68ea0 /lib/keystroke.h | |
parent | c933cf7233f51f677ab01689f175ceb3dc5361f6 (diff) | |
download | quagga-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.h | 13 |
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 |