aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-09-24 11:27:19 +0200
committerJiri Slaby <jslaby@suse.cz>2020-09-25 13:20:58 +0200
commitb66b23e0559e312bc46d975f7edd0f80c01178d7 (patch)
tree03ce097765af52189e3e8565ffa5de6b95f27c77
parent4ca33228cfc0c0efa65b3cf333820442978b2e47 (diff)
downloadkbd-b66b23e0559e312bc46d975f7edd0f80c01178d7.tar.gz
libkeymap: note about --unicode use
Note to the generated file that we used --unicode. Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--src/libkeymap/dump.c8
-rw-r--r--tests/data/dumpkeys-mktable/defkeymap.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/libkeymap/dump.c b/src/libkeymap/dump.c
index c5a71d9d..b5fb5fda 100644
--- a/src/libkeymap/dump.c
+++ b/src/libkeymap/dump.c
@@ -123,14 +123,16 @@ int lk_dump_ctable(struct lk_ctx *ctx, FILE *fd)
long func_table_offs[MAX_NR_FUNC];
long func_buf_offset = 0;
struct lk_kbdiacr *kddiac;
+ int unicode = ctx->flags & LK_FLAG_PREFER_UNICODE;
if (lk_add_constants(ctx) < 0)
return -1;
fprintf(fd,
/* not to be translated... */
- "/* Do not edit this file! It was automatically generated by */\n");
- fprintf(fd, "/* loadkeys --mktable defkeymap.map > defkeymap.c */\n\n");
+ "/* Do not edit this file! It was automatically generated by */\n");
+ fprintf(fd, "/* loadkeys --mktable %sdefkeymap.map > defkeymap.c %*c*/\n\n",
+ unicode ? "--unicode " : "", unicode ? 1 : 11, ' ');
fprintf(fd, "#include <linux/keyboard.h>\n");
fprintf(fd, "#include <linux/kd.h>\n\n");
@@ -210,7 +212,7 @@ int lk_dump_ctable(struct lk_ctx *ctx, FILE *fd)
fprintf(fd, "\t0,\n");
fprintf(fd, "};\n");
- if (ctx->flags & LK_FLAG_PREFER_UNICODE) {
+ if (unicode) {
fprintf(fd, "\nstruct kbdiacruc accent_table[MAX_DIACR] = {\n");
for (i = 0; i < ctx->accent_table->count; i++) {
kddiac = lk_array_get_ptr(ctx->accent_table, i);
diff --git a/tests/data/dumpkeys-mktable/defkeymap.c b/tests/data/dumpkeys-mktable/defkeymap.c
index b21f55ab..e81f261b 100644
--- a/tests/data/dumpkeys-mktable/defkeymap.c
+++ b/tests/data/dumpkeys-mktable/defkeymap.c
@@ -1,5 +1,5 @@
-/* Do not edit this file! It was automatically generated by */
-/* loadkeys --mktable defkeymap.map > defkeymap.c */
+/* Do not edit this file! It was automatically generated by */
+/* loadkeys --mktable defkeymap.map > defkeymap.c */
#include <linux/keyboard.h>
#include <linux/kd.h>