diff options
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 |