1#ifndef __XCB_ATOM_H__
2#define __XCB_ATOM_H__
3
4#include <xcb/xcb.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10enum xcb_atom_fast_tag_t {
11	TAG_COOKIE,
12	TAG_VALUE
13};
14typedef struct {
15	enum xcb_atom_fast_tag_t tag;
16	union {
17		xcb_intern_atom_cookie_t cookie;
18		xcb_atom_t atom;
19	} u;
20} xcb_atom_fast_cookie_t;
21
22/**
23 * @brief Get an atom synchronously.
24 * @param connection The connection to the X server.
25 * @param atom_name The name of the atom that should be returned.
26 * @return The requested atom, or XCB_NONE if there is an error.
27 *
28 * xcb_atom_get() is essentially a synchronous version of xcb_intern_atom(),
29 * use it only on non-performance critical execution paths.
30 */
31xcb_atom_t xcb_atom_get(xcb_connection_t *connection, const char *atom_name);
32xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name);
33xcb_atom_fast_cookie_t xcb_atom_get_fast(xcb_connection_t *c, uint8_t only_if_exists, uint16_t name_len, const char *name);
34xcb_atom_t xcb_atom_get_fast_reply(xcb_connection_t *c, xcb_atom_fast_cookie_t cookie, xcb_generic_error_t **e);
35
36const char *xcb_atom_get_name_predefined(xcb_atom_t atom);
37int xcb_atom_get_name(xcb_connection_t *c, xcb_atom_t atom, const char **namep, int *lengthp);
38
39char *xcb_atom_name_by_screen(const char *base, uint8_t screen);
40char *xcb_atom_name_by_resource(const char *base, uint32_t resource);
41char *xcb_atom_name_unique(const char *base, uint32_t id);
42
43define(`DO', `extern const xcb_atom_t $1;')dnl
44include(atomlist.m4)`'dnl
45
46#ifdef __cplusplus
47}
48#endif
49
50#endif /* __XCB_ATOM_H__ */
51