Rename struct keymap to lk_ctx
[platform/upstream/kbd.git] / src / libkeymap / keymap / context.h
1 #ifndef LK_DATA_H
2 #define LK_DATA_H
3
4 #include <linux/kd.h>
5 #include <linux/keyboard.h>
6 #include <keymap/findfile.h>
7 #include <keymap/array.h>
8
9 struct kb_diacr {
10         unsigned int diacr, base, result;
11 };
12
13 typedef enum {
14         LK_FLAG_UNICODE_MODE  = (1 << 1),
15         LK_FLAG_CLEAR_COMPOSE = (1 << 2),
16         LK_FLAG_CLEAR_STRINGS = (1 << 3),
17         LK_FLAG_PREFER_UNICODE= (1 << 4)
18 } lk_flags;
19
20 typedef enum {
21         LK_KEYWORD_KEYMAPS    = (1 << 1),
22         LK_KEYWORD_ALTISMETA  = (1 << 2),
23         LK_KEYWORD_CHARSET    = (1 << 3),
24         LK_KEYWORD_STRASUSUAL = (1 << 4)
25 } lk_keywords;
26
27 #define MAX_INCLUDE_DEPTH 20
28
29 struct lk_ctx {
30         /* Parser flags */
31         lk_flags flags;
32
33         /* Keymap keywords (keymaps, alt-is-meta, charset, ...) */
34         lk_keywords keywords;
35
36         struct lk_array *keymap;
37
38         /* the kernel structures we want to set or print */
39         struct lk_array *func_table;
40
41         struct lk_array *accent_table;
42         struct lk_array *key_constant;
43
44         /* Key definitions on one line */
45         struct lk_array *key_line;
46
47         /* Line by line modifiers */
48         int mod;
49
50         unsigned int charset;
51
52         lkfile_t *stack[MAX_INCLUDE_DEPTH];
53
54         int log_priority;
55         void (*log_fn)(void *data, int priority,
56                        const char *file, int line, const char *fn,
57                        const char *format, va_list args);
58         void *log_data;
59 };
60
61 #endif /* LK_DATA_H */