Commit d67a94d374956940d58fb6370354de754ae07c93

Daniel Stone 2012-03-09T18:57:14

Remove atom functions from public API They're no longer needed since we don't expose any atoms in the published API anymore. As a result, we don't need to support external atom implementations either. Result! Signed-off-by: Daniel Stone <daniel@fooishbar.org>

diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index a8f6738..fcc9b62 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -532,15 +532,6 @@ struct xkb_state {
 
 _XFUNCPROTOBEGIN
 
-typedef uint32_t (*InternAtomFuncPtr)(const char *val);
-typedef const char *(*GetAtomValueFuncPtr)(uint32_t atom);
-
-_X_EXPORT extern void
-xkb_init_atoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value);
-
-_X_EXPORT extern uint32_t
-xkb_intern_atom(const char *name);
-
 _X_EXPORT extern struct xkb_desc *
 xkb_compile_keymap_from_rules(const struct xkb_rule_names *rules);
 
diff --git a/src/atom.c b/src/atom.c
index 09ff9ad..43e8fad 100644
--- a/src/atom.c
+++ b/src/atom.c
@@ -92,28 +92,12 @@ static uint32_t lastAtom = None;
 static NodePtr atomRoot = NULL;
 static unsigned long tableLength;
 static NodePtr *nodeTable = NULL;
-static InternAtomFuncPtr do_intern_atom = NULL;
-static GetAtomValueFuncPtr do_get_atom_value = NULL;
-
-void
-xkb_init_atoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value)
-{
-    if (intern && get_atom_value) {
-        if (do_intern_atom && do_get_atom_value)
-            return;
-        do_intern_atom = intern;
-        do_get_atom_value = get_atom_value;
-    }
-}
 
 const char *
 XkbcAtomText(uint32_t atom)
 {
     NodePtr node;
 
-    if (do_get_atom_value)
-        return do_get_atom_value(atom);
-
     if ((atom == None) || (atom > lastAtom))
         return NULL;
     if (!(node = nodeTable[atom]))
@@ -140,8 +124,6 @@ xkb_intern_atom(const char *string)
 
     if (!string)
 	return None;
-    if (do_intern_atom)
-	return do_intern_atom(string);
 
     len = strlen(string);
     np = &atomRoot;
diff --git a/src/xkbmisc.h b/src/xkbmisc.h
index 32d2382..3271f31 100644
--- a/src/xkbmisc.h
+++ b/src/xkbmisc.h
@@ -67,6 +67,9 @@ XkbcNameMatchesPattern(char *name, char *ptrn);
 
 /***====================================================================***/
 
+extern uint32_t
+xkb_intern_atom(const char *string);
+
 extern char *
 XkbcAtomGetString(uint32_t atom);