Fix missing includes
[centerim5.git] / cppconsui / libtermkey / termkey-internal.h
blobc1f4cd6fa935d324c2c92be916c3c4d0b8a111f7
1 #ifndef GUARD_TERMKEY_INTERNAL_H_
2 #define GUARD_TERMKEY_INTERNAL_H_
4 #include "termkey.h"
6 #include <stdint.h>
7 #include <termios.h>
9 struct TermKeyDriver
11 const char *name;
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);
19 struct keyinfo {
20 TermKeyType type;
21 TermKeySym sym;
22 int modifier_mask;
23 int modifier_set;
26 struct TermKeyDriverNode;
27 struct TermKeyDriverNode {
28 struct TermKeyDriver *driver;
29 void *info;
30 struct TermKeyDriverNode *next;
33 struct _TermKey {
34 int fd;
35 int flags;
36 int canonflags;
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;
45 int waittime; // msec
47 char is_closed;
49 int nkeynames;
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
59 struct {
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);
63 } method;
66 extern struct TermKeyDriver termkey_driver_csi;
67 extern struct TermKeyDriver termkey_driver_ti;
69 #endif