tools: print the kccgst format in a usable syntax
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 23 Jun 2020 22:59:29 +0000 (08:59 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 25 Jun 2020 00:32:08 +0000 (10:32 +1000)
Might as well spit that out in the format that e.g. xkbcomp understands.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/rmlvo-to-kccgst.c

index ab9336e..9501890 100644 (file)
@@ -90,10 +90,12 @@ main(int argc, char *argv[])
     if (!xkb_components_from_rules(ctx, &rmlvo, &kccgst))
         return 1;
 
-    printf("keycodes: %s\n", kccgst.keycodes);
-    printf("types:    %s\n", kccgst.types);
-    printf("compat:   %s\n", kccgst.compat);
-    printf("symbols:  %s\n", kccgst.symbols);
+    printf("xkb_keymap {\n"
+           "  xkb_keycodes { include \"%s\" };\n"
+           "  xkb_types { include \"%s\" };\n"
+           "  xkb_compat { include \"%s\" };\n"
+           "  xkb_symbols { include \"%s\" };\n"
+           "};\n", kccgst.keycodes, kccgst.types, kccgst.compat, kccgst.symbols);
 
     free(kccgst.keycodes);
     free(kccgst.types);