summaryrefslogtreecommitdiffstats
path: root/src/locale/xkbcommon-util.h
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-02-01 18:47:47 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-03-25 07:27:23 +0100
commitd45cbc071144c5003d2dc35d388790dacad6e6f0 (patch)
tree85760269b9053dfedef9bc6ea230f31f2cb5f953 /src/locale/xkbcommon-util.h
parentlocale: split out checking existence of keymap (diff)
downloadsystemd-d45cbc071144c5003d2dc35d388790dacad6e6f0.tar.xz
systemd-d45cbc071144c5003d2dc35d388790dacad6e6f0.zip
locale: split out xkbcommon related functions to xkbcommon-util.c
Then, use dlopen_many_sym_or_warn() with DLSYM_ARG() macro.
Diffstat (limited to '')
-rw-r--r--src/locale/xkbcommon-util.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/locale/xkbcommon-util.h b/src/locale/xkbcommon-util.h
new file mode 100644
index 0000000000..e99c2d7783
--- /dev/null
+++ b/src/locale/xkbcommon-util.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#if HAVE_XKBCOMMON
+#include <xkbcommon/xkbcommon.h>
+
+extern struct xkb_context* (*sym_xkb_context_new)(enum xkb_context_flags flags);
+extern void (*sym_xkb_context_unref)(struct xkb_context *context);
+extern void (*sym_xkb_context_set_log_fn)(
+ struct xkb_context *context,
+ void (*log_fn)(
+ struct xkb_context *context,
+ enum xkb_log_level level,
+ const char *format,
+ va_list args));
+extern struct xkb_keymap* (*sym_xkb_keymap_new_from_names)(
+ struct xkb_context *context,
+ const struct xkb_rule_names *names,
+ enum xkb_keymap_compile_flags flags);
+extern void (*sym_xkb_keymap_unref)(struct xkb_keymap *keymap);
+
+int verify_xkb_rmlvo(const char *model, const char *layout, const char *variant, const char *options);
+
+#else
+
+static inline int verify_xkb_rmlvo(const char *model, const char *layout, const char *variant, const char *options) {
+ return 0;
+}
+
+#endif