summaryrefslogtreecommitdiff
path: root/src/xkbcomp/xkbcomp.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-08-03 02:57:02 +0200
committerDaniel Stone <daniel@fooishbar.org>2012-08-08 16:23:30 +0200
commit5cf4f510444759fb7b158f341411f19c8fbd8ebf (patch)
tree3ffac36563a26ad9bb62ca59cddbc3c32cf4056f /src/xkbcomp/xkbcomp.c
parent1eda9e44b1f1a883016fe4dc0129155ecd1e389a (diff)
downloadlibxkbcommon-5cf4f510444759fb7b158f341411f19c8fbd8ebf.tar.gz
libxkbcommon-5cf4f510444759fb7b158f341411f19c8fbd8ebf.tar.bz2
libxkbcommon-5cf4f510444759fb7b158f341411f19c8fbd8ebf.zip
Staticise xkb_map_new_from_kccgst
We didn't expose this to the outside world, and its only trivial user was xkb_map_new_from_rules. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src/xkbcomp/xkbcomp.c')
-rw-r--r--src/xkbcomp/xkbcomp.c57
1 files changed, 11 insertions, 46 deletions
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index b18cd70..fc23c51 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -200,58 +200,15 @@ err:
return NULL;
}
-struct xkb_keymap *
-xkb_map_new_from_kccgst(struct xkb_context *ctx,
- const struct xkb_component_names *kccgst,
- enum xkb_map_compile_flags flags)
-{
- XkbFile *file;
- struct xkb_keymap *keymap;
-
- if (!kccgst) {
- log_err(ctx, "No components specified\n");
- return NULL;
- }
-
- if (ISEMPTY(kccgst->keycodes)) {
- log_err(ctx, "Keycodes required to generate XKB keymap\n");
- return NULL;
- }
-
- if (ISEMPTY(kccgst->compat)) {
- log_err(ctx, "Compat map required to generate XKB keymap\n");
- return NULL;
- }
-
- if (ISEMPTY(kccgst->types)) {
- log_err(ctx, "Types required to generate XKB keymap\n");
- return NULL;
- }
-
- if (ISEMPTY(kccgst->symbols)) {
- log_err(ctx, "Symbols required to generate XKB keymap\n");
- return NULL;
- }
-
- file = keymap_file_from_components(ctx, kccgst);
- if (!file) {
- log_err(ctx, "Failed to generate parsed XKB file from components\n");
- return NULL;
- }
-
- keymap = compile_keymap(ctx, file);
- FreeXKBFile(file);
- return keymap;
-}
-
XKB_EXPORT struct xkb_keymap *
xkb_map_new_from_names(struct xkb_context *ctx,
const struct xkb_rule_names *rmlvo_in,
enum xkb_map_compile_flags flags)
{
struct xkb_component_names *kkctgs;
- struct xkb_keymap *keymap;
+ struct xkb_keymap *keymap = NULL;
struct xkb_rule_names rmlvo = *rmlvo_in;
+ XkbFile *file;
if (ISEMPTY(rmlvo.rules))
rmlvo.rules = DEFAULT_XKB_RULES;
@@ -267,8 +224,16 @@ xkb_map_new_from_names(struct xkb_context *ctx,
return NULL;
}
- keymap = xkb_map_new_from_kccgst(ctx, kkctgs, 0);
+ file = keymap_file_from_components(ctx, kkctgs);
+ if (!file) {
+ log_err(ctx, "Failed to generate parsed XKB file from components\n");
+ goto out;
+ }
+
+ keymap = compile_keymap(ctx, file);
+ FreeXKBFile(file);
+out:
free(kkctgs->keycodes);
free(kkctgs->types);
free(kkctgs->compat);