diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-03-21 01:16:05 +0000 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-03-21 01:16:05 +0000 |
commit | 9470cb2c32eab220f796b1438b787528272cbe84 (patch) | |
tree | b9b2cc12446173436d2bc7a32e82cc3378ec721e /lib/keystroke.h | |
parent | 5cae7eea451f2b7d65b5892e2c1dafc70f8b836e (diff) | |
download | quagga-ex11p.tar.bz2 quagga-ex11p.tar.xz |
Upgrade of "pipework" -- including piping to/from shell commandsex11p
Version 0.99.15ex11p
A major overhaul.
Diffstat (limited to 'lib/keystroke.h')
-rw-r--r-- | lib/keystroke.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/keystroke.h b/lib/keystroke.h index 67c6cd0f..70aa120b 100644 --- a/lib/keystroke.h +++ b/lib/keystroke.h @@ -47,13 +47,14 @@ enum keystroke_type ks_type_reserved = 0x0F, } ; -typedef enum keystroke_type keystroke_type ; +typedef enum keystroke_type keystroke_type_t ; CONFIRM(ks_type_count <= ks_type_reserved) ; enum keystroke_null { knull_not_eof, - knull_eof + knull_eof, + knull_timed_out, }; enum keystroke_flags @@ -69,23 +70,30 @@ enum keystroke_flags kf_type_mask = 0x0F, /* extraction of type */ } ; -typedef enum keystroke_type keystroke_flags ; +typedef enum keystroke_type keystroke_flags_t ; -CONFIRM(ks_type_reserved == (keystroke_type)kf_type_mask) ; +/* The keystroke type and flags are designed so that they can be packed + * together as a single byte, the first of a "compound character". + */ +typedef uint8_t keystroke_compound_t ; + +CONFIRM(ks_type_reserved == (keystroke_type_t)kf_type_mask) ; +CONFIRM((kf_compound | kf_flag_mask | kf_type_mask) <= 0xFF) ; typedef struct keystroke* keystroke ; typedef struct keystroke_stream* keystroke_stream ; struct keystroke { - enum keystroke_type type ; - uint8_t flags ; /* the kf_flag_mask flags */ + keystroke_type_t type ; + keystroke_flags_t flags ; /* just the kf_flag_mask bits */ uint32_t value ; unsigned len ; uint8_t buf[keystroke_max_len] ; } ; +typedef struct keystroke keystroke_t[1] ; #define keystroke_iac_callback_args void* context, keystroke stroke typedef bool (keystroke_callback)(keystroke_iac_callback_args) ; @@ -171,7 +179,7 @@ keystroke_stream_new(uint8_t csi_char, keystroke_callback* iac_callback, void* iac_callback_context) ; extern void -keystroke_stream_set_eof(keystroke_stream stream) ; +keystroke_stream_set_eof(keystroke_stream stream, bool timed_out) ; extern keystroke_stream keystroke_stream_free(keystroke_stream stream) ; |