| 1 |
/* |
| 2 |
* Copyright © 2009 Dan Nicholson |
| 3 |
* SPDX-License-Identifier: MIT |
| 4 |
*/ |
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include "config.h" |
| 8 |
|
| 9 |
#include <stddef.h> |
| 10 |
#include <stdint.h> |
| 11 |
#include <stdbool.h> |
| 12 |
|
| 13 |
#include "darray.h" |
| 14 |
#include "utils.h" |
| 15 |
|
| 16 |
/** Atoms are indexes into a `darray` */ |
| 17 |
typedef darray_size_t xkb_atom_t; |
| 18 |
|
| 19 |
#define XKB_ATOM_NONE 0 |
| 20 |
|
| 21 |
struct atom_table; |
| 22 |
|
| 23 |
XKB_EXPORT_PRIVATE struct atom_table * |
| 24 |
atom_table_new(void); |
| 25 |
|
| 26 |
XKB_EXPORT_PRIVATE void |
| 27 |
atom_table_free(struct atom_table *table); |
| 28 |
|
| 29 |
XKB_EXPORT_PRIVATE darray_size_t |
| 30 |
atom_table_size(struct atom_table *table); |
| 31 |
|
| 32 |
XKB_EXPORT_PRIVATE xkb_atom_t |
| 33 |
atom_intern(struct atom_table *table, const char *string, size_t len, bool add); |
| 34 |
|
| 35 |
XKB_EXPORT_PRIVATE const char * |
| 36 |
atom_text(struct atom_table *table, xkb_atom_t atom); |