Add flags to context creation
authorDaniel Stone <daniel@fooishbar.org>
Tue, 8 May 2012 16:51:16 +0000 (17:51 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Tue, 8 May 2012 16:51:16 +0000 (17:51 +0100)
None defined as yet, but why not.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
include/xkbcommon/xkbcommon.h
src/context.c
test/context.c
test/filecomp.c
test/namescomp.c
test/rulescomp.c
test/state.c

index ebb9aa4..31570f2 100644 (file)
@@ -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.
index 1c080d3..39c1326 100644 (file)
@@ -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));
 
index 4009eff..016c5ea 100644 (file)
@@ -30,7 +30,7 @@
 int
 main(void)
 {
-    struct xkb_context *context = xkb_context_new();
+    struct xkb_context *context = xkb_context_new(0);
 
     assert(context);
 
index 70dbdc2..d387044 100644 (file)
@@ -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");
index e8652a2..36c89f3 100644 (file)
@@ -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,
index 5ab8112..91b91b4 100644 (file)
@@ -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,
index d405b3e..1d8d138 100644 (file)
@@ -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);