From 699a0b841c26020815cf276980ad5ccaded7494a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 9 May 2012 14:02:26 +0300 Subject: 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 [daniels: Updated for xkb -> keymap.] --- src/atom.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/atom.h') 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 */ -- cgit v1.2.1