summaryrefslogtreecommitdiff
path: root/src/atom.h
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-05-09 14:02:26 +0300
committerDaniel Stone <daniel@fooishbar.org>2012-05-09 15:56:25 +0100
commit699a0b841c26020815cf276980ad5ccaded7494a (patch)
tree6cb566f798f04345086ec2ab48848c2847f3c0fa /src/atom.h
parentcdd2906de3db99f63c9dba0de27d8299198d2517 (diff)
downloadxorg-lib-libxkbcommon-699a0b841c26020815cf276980ad5ccaded7494a.tar.gz
Contextualize the atom table
Each context gets its own table, i.e. interning a string in one context does not affect any other context. The existing xkb_atom_* functions are turned into wrappers around a new standalone atom_table object. Signed-off-by: Ran Benita <ran234@gmail.com> [daniels: Updated for xkb -> keymap.]
Diffstat (limited to 'src/atom.h')
-rw-r--r--src/atom.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/atom.h b/src/atom.h
index d9fc0b8..6294106 100644
--- a/src/atom.h
+++ b/src/atom.h
@@ -29,20 +29,21 @@ authorization from the authors.
#include "xkb-priv.h"
-typedef uint32_t xkb_atom_t;
+struct atom_table;
-#define XKB_ATOM_NONE 0
+struct atom_table *
+atom_table_new(void);
-extern xkb_atom_t
-xkb_atom_intern(struct xkb_context *context, const char *string);
+void
+atom_table_free(struct atom_table *table);
-extern char *
-xkb_atom_strdup(struct xkb_context *context, xkb_atom_t atom);
+xkb_atom_t
+atom_intern(struct atom_table *table, const char *string);
-extern const char *
-xkb_atom_text(struct xkb_context *context, xkb_atom_t atom);
+char *
+atom_strdup(struct atom_table *table, xkb_atom_t atom);
-extern void
-XkbcFreeAllAtoms(void);
+const char *
+atom_text(struct atom_table *table, xkb_atom_t atom);
#endif /* ATOM_H */