summaryrefslogtreecommitdiff
path: root/dist/xcb-util/atom/xcb_atom.h.m4
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-05-23 14:38:22 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-05-23 14:38:22 +0000
commit86bb951017acff65627eb198fe1fa4c73b46aad4 (patch)
tree18afd632e81d724b548b60373016d1459dfce5f3 /dist/xcb-util/atom/xcb_atom.h.m4
parent013b4a3065ff281c23c32277f08a521fd7922c23 (diff)
import xcb-util 0.3.4
Diffstat (limited to 'dist/xcb-util/atom/xcb_atom.h.m4')
-rw-r--r--dist/xcb-util/atom/xcb_atom.h.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/dist/xcb-util/atom/xcb_atom.h.m4 b/dist/xcb-util/atom/xcb_atom.h.m4
new file mode 100644
index 000000000..7eb44cd0e
--- /dev/null
+++ b/dist/xcb-util/atom/xcb_atom.h.m4
@@ -0,0 +1,42 @@
+#ifndef __XCB_ATOM_H__
+#define __XCB_ATOM_H__
+
+#include <xcb/xcb.h>
+
+enum xcb_atom_fast_tag_t {
+ TAG_COOKIE,
+ TAG_VALUE
+};
+typedef struct {
+ enum xcb_atom_fast_tag_t tag;
+ union {
+ xcb_intern_atom_cookie_t cookie;
+ xcb_atom_t atom;
+ } u;
+} xcb_atom_fast_cookie_t;
+
+/**
+ * @brief Get an atom synchronously.
+ * @param connection The connection to the X server.
+ * @param atom_name The name of the atom that should be returned.
+ * @return The requested atom, or XCB_NONE if there is an error.
+ *
+ * xcb_atom_get() is essentially a synchronous version of xcb_intern_atom(),
+ * use it only on non-performance critical execution paths.
+ */
+xcb_atom_t xcb_atom_get(xcb_connection_t *connection, const char *atom_name);
+xcb_atom_t xcb_atom_get_predefined(uint16_t name_len, const char *name);
+xcb_atom_fast_cookie_t xcb_atom_get_fast(xcb_connection_t *c, uint8_t only_if_exists, uint16_t name_len, const char *name);
+xcb_atom_t xcb_atom_get_fast_reply(xcb_connection_t *c, xcb_atom_fast_cookie_t cookie, xcb_generic_error_t **e);
+
+const char *xcb_atom_get_name_predefined(xcb_atom_t atom);
+int xcb_atom_get_name(xcb_connection_t *c, xcb_atom_t atom, const char **namep, int *lengthp);
+
+char *xcb_atom_name_by_screen(const char *base, uint8_t screen);
+char *xcb_atom_name_by_resource(const char *base, uint32_t resource);
+char *xcb_atom_name_unique(const char *base, uint32_t id);
+
+define(`DO', `extern const xcb_atom_t $1;')dnl
+include(atomlist.m4)`'dnl
+
+#endif /* __XCB_ATOM_H__ */