summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2013-08-02 10:19:01 +0300
committerRan Benita <ran234@gmail.com>2014-01-13 17:21:56 +0200
commit4884a8e636cede13c7598fe49d1fc35d22f78f14 (patch)
tree00be47ba74f76434279ba9712eefbaefccbd63c3 /src
parentd63e0ab838ac0911f955c7b34e85aa3d8f033d19 (diff)
downloadxorg-lib-libxkbcommon-4884a8e636cede13c7598fe49d1fc35d22f78f14.tar.gz
keymap: move XkbEscapeMapName() to keymap.c.
So we can use it outside src/xkbcomp; it is not really specific to it. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c24
-rw-r--r--src/keymap.h3
-rw-r--r--src/xkbcomp/ast-build.c24
-rw-r--r--src/xkbcomp/xkbcomp-priv.h3
4 files changed, 27 insertions, 27 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 96d250c..6f644ce 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -574,3 +574,27 @@ XkbResolveKeyAlias(struct xkb_keymap *keymap, xkb_atom_t name)
return XKB_ATOM_NONE;
}
+
+void
+XkbEscapeMapName(char *name)
+{
+ /*
+ * All latin-1 alphanumerics, plus parens, slash, minus, underscore and
+ * wildcards.
+ */
+ static const unsigned char legal[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x83,
+ 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff
+ };
+
+ if (!name)
+ return;
+
+ while (*name) {
+ if (!(legal[*name / 8] & (1 << (*name % 8))))
+ *name = '_';
+ name++;
+ }
+}
diff --git a/src/keymap.h b/src/keymap.h
index d8cc5ce..80522e8 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -418,6 +418,9 @@ XkbKeyByName(struct xkb_keymap *keymap, xkb_atom_t name, bool use_aliases);
xkb_atom_t
XkbResolveKeyAlias(struct xkb_keymap *keymap, xkb_atom_t name);
+void
+XkbEscapeMapName(char *name);
+
xkb_layout_index_t
wrap_group_into_range(int32_t group,
xkb_layout_index_t num_groups,
diff --git a/src/xkbcomp/ast-build.c b/src/xkbcomp/ast-build.c
index cc16196..d470884 100644
--- a/src/xkbcomp/ast-build.c
+++ b/src/xkbcomp/ast-build.c
@@ -495,30 +495,6 @@ err:
return NULL;
}
-void
-XkbEscapeMapName(char *name)
-{
- /*
- * All latin-1 alphanumerics, plus parens, slash, minus, underscore and
- * wildcards.
- */
- static const unsigned char legal[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x83,
- 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff
- };
-
- if (!name)
- return;
-
- while (*name) {
- if (!(legal[*name / 8] & (1 << (*name % 8))))
- *name = '_';
- name++;
- }
-}
-
XkbFile *
XkbFileCreate(struct xkb_context *ctx, enum xkb_file_type type, char *name,
ParseCommon *defs, enum xkb_map_flags flags)
diff --git a/src/xkbcomp/xkbcomp-priv.h b/src/xkbcomp/xkbcomp-priv.h
index 7e21d53..6cb774d 100644
--- a/src/xkbcomp/xkbcomp-priv.h
+++ b/src/xkbcomp/xkbcomp-priv.h
@@ -56,9 +56,6 @@ XkbFile *
XkbFileFromComponents(struct xkb_context *ctx,
const struct xkb_component_names *kkctgs);
-void
-XkbEscapeMapName(char *name);
-
bool
CompileKeycodes(XkbFile *file, struct xkb_keymap *keymap,
enum merge_mode merge);