summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-09-23 17:52:51 +0200
committerDaniel Stone <daniel@fooishbar.org>2012-09-24 09:13:32 +1000
commit9a18b87251d1111987e98926a9aba9e72afc0259 (patch)
tree459f2e0b34c7ae96d030c395e1bfcb5aa93bf54d /test
parent5d31b9e3e706df2256295d5c92b74935d1e9fbcd (diff)
Add format argument to xkb_keymap_get_as_string
This function really needs a format argument, for symmetry with the keymap creation functions. If we add new formats, we will almost certainly want to add support for serializing it into a string. It would also allow to convert from one format to another, etc. The in the common case, the user would just want to use the format she used to create the keymap; for that we add a special XKB_KEYMAP_USE_ORIGINAL_FORMAT value, which will do that (it is defined to -1 outside of the enum because I have a feeling we might want to use 0 for something else). To support this we need to keep the format inside the keymap. While we're at it we also initialize keymap flags properly. This changes the API, but the old xkb_map_get_as_string name works as expected so this is the best time to do this. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/print-compiled-keymap.c2
-rw-r--r--test/stringcomp.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/print-compiled-keymap.c b/test/print-compiled-keymap.c
index 95bd85a..0e14205 100644
--- a/test/print-compiled-keymap.c
+++ b/test/print-compiled-keymap.c
@@ -87,7 +87,7 @@ main(int argc, char *argv[])
goto err_ctx;
}
- dump = xkb_keymap_get_as_string(keymap);
+ dump = xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1);
if (!dump) {
fprintf(stderr, "Couldn't get the keymap string\n");
goto err_map;
diff --git a/test/stringcomp.c b/test/stringcomp.c
index e00e92f..e95a3c4 100644
--- a/test/stringcomp.c
+++ b/test/stringcomp.c
@@ -47,7 +47,7 @@ main(int argc, char *argv[])
keymap = test_compile_string(ctx, original);
assert(keymap);
- dump = xkb_keymap_get_as_string(keymap);
+ dump = xkb_keymap_get_as_string(keymap, XKB_KEYMAP_USE_ORIGINAL_FORMAT);
assert(dump);
if (!streq(original, dump)) {