1 #ifndef GUARD_TERMKEY_INTERNAL_H_
2 #define GUARD_TERMKEY_INTERNAL_H_
12 void *(*new_driver
)(TermKey
*tk
, const char *term
);
13 void (*free_driver
)(void *info
);
14 void (*start_driver
)(TermKey
*tk
, void *info
);
15 void (*stop_driver
)(TermKey
*tk
, void *info
);
16 TermKeyResult (*peekkey
)(TermKey
*tk
, void *info
, TermKeyKey
*key
, int force
, size_t *nbytes
);
26 struct TermKeyDriverNode
;
27 struct TermKeyDriverNode
{
28 struct TermKeyDriver
*driver
;
30 struct TermKeyDriverNode
*next
;
37 unsigned char *buffer
;
38 size_t buffstart
; // First offset in buffer
39 size_t buffcount
; // NUMBER of entires valid in buffer
40 size_t buffsize
; // Total malloc'ed size
42 struct termios restore_termios
;
43 char restore_termios_valid
;
50 const char **keynames
;
52 // There are 32 C0 codes
53 struct keyinfo c0
[32];
55 struct TermKeyDriverNode
*drivers
;
57 // Now some "protected" methods for the driver to call but which we don't
58 // want exported as real symbols in the library
60 void (*emit_codepoint
)(TermKey
*tk
, long codepoint
, TermKeyKey
*key
);
61 TermKeyResult (*peekkey_simple
)(TermKey
*tk
, TermKeyKey
*key
, int force
, size_t *nbytes
);
62 TermKeyResult (*peekkey_mouse
)(TermKey
*tk
, TermKeyKey
*key
, size_t *nbytes
);
66 extern struct TermKeyDriver termkey_driver_csi
;
67 extern struct TermKeyDriver termkey_driver_ti
;