Add flags to context creation None defined as yet, but why not. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index ebb9aa4..31570f2 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -193,13 +193,18 @@ xkb_string_to_keysym(const char *s);
* @{
*/
+enum xkb_context_flags {
+ /** Apparently you can't have empty enums. What a drag. */
+ XKB_CONTEXT_PLACEHOLDER = 0,
+};
+
/**
* Returns a new XKB context, or NULL on failure. If successful, the caller
* holds a reference on the context, and must free it when finished with
* xkb_context_unref().
*/
struct xkb_context *
-xkb_context_new(void);
+xkb_context_new(enum xkb_context_flags flags);
/**
* Appends a new entry to the include path used for keymap compilation.
diff --git a/src/context.c b/src/context.c
index 1c080d3..39c1326 100644
--- a/src/context.c
+++ b/src/context.c
@@ -177,7 +177,7 @@ xkb_context_unref(struct xkb_context *context)
* Create a new context.
*/
_X_EXPORT struct xkb_context *
-xkb_context_new(void)
+xkb_context_new(enum xkb_context_flags flags)
{
struct xkb_context *context = calloc(1, sizeof(*context));
diff --git a/test/context.c b/test/context.c
index 4009eff..016c5ea 100644
--- a/test/context.c
+++ b/test/context.c
@@ -30,7 +30,7 @@
int
main(void)
{
- struct xkb_context *context = xkb_context_new();
+ struct xkb_context *context = xkb_context_new(0);
assert(context);
diff --git a/test/filecomp.c b/test/filecomp.c
index 70dbdc2..d387044 100644
--- a/test/filecomp.c
+++ b/test/filecomp.c
@@ -46,7 +46,7 @@ test_file(const char *path)
fd = open(path, O_RDONLY);
assert(fd >= 0);
- context = xkb_context_new();
+ context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling path: %s\n", path);
@@ -81,7 +81,7 @@ test_string(const char *string)
struct xkb_context *context;
struct xkb_keymap *xkb;
- context = xkb_context_new();
+ context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling string\n");
diff --git a/test/namescomp.c b/test/namescomp.c
index e8652a2..36c89f3 100644
--- a/test/namescomp.c
+++ b/test/namescomp.c
@@ -46,7 +46,7 @@ test_names(const char *keycodes, const char *types,
.symbols = strdup(symbols),
};
- context = xkb_context_new();
+ context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s\n", kccgst.keycodes, kccgst.types,
diff --git a/test/rulescomp.c b/test/rulescomp.c
index 5ab8112..91b91b4 100644
--- a/test/rulescomp.c
+++ b/test/rulescomp.c
@@ -43,7 +43,7 @@ test_rmlvo(const char *rules, const char *model, const char *layout,
.options = options
};
- context = xkb_context_new();
+ context = xkb_context_new(0);
assert(context);
fprintf(stderr, "\nCompiling %s %s %s %s %s\n", rmlvo.rules, rmlvo.model,
diff --git a/test/state.c b/test/state.c
index d405b3e..1d8d138 100644
--- a/test/state.c
+++ b/test/state.c
@@ -215,7 +215,7 @@ main(void)
.options = NULL,
};
- context = xkb_context_new();
+ context = xkb_context_new(0);
assert(context);
xkb = xkb_map_new_from_names(context, &rmlvo, 0);