diff options
author | Ran Benita <ran234@gmail.com> | 2012-05-09 14:02:26 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2012-05-09 15:56:25 +0100 |
commit | 699a0b841c26020815cf276980ad5ccaded7494a (patch) | |
tree | 6cb566f798f04345086ec2ab48848c2847f3c0fa /src/atom.h | |
parent | cdd2906de3db99f63c9dba0de27d8299198d2517 (diff) | |
download | xorg-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.h | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -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 */ |