summaryrefslogtreecommitdiff
path: root/src/xcb.h
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2010-02-09 16:27:22 -0500
committerPeter Harris <pharris@opentext.com>2010-02-11 14:35:37 -0500
commit367882fa32489ebafcd9afc04fbf732b02ceb33a (patch)
tree340fdb779ae2ace85efc24a1b0cbe3b0f92d871a /src/xcb.h
parentbe7e528eae62ddee14fa50f2c0e9036bafbc9f81 (diff)
Support xcb_discard_reply
This function is useful for dynamic language garbage collectors. Frequently a GC cycle may run before you want to block wainting for a reply. This function is also marginally useful for libxcb apps that issue speculative requests (eg. xlsclients). Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Eamon Walsh <efw@eamonwalsh.com> Signed-off-by: Peter Harris <pharris@opentext.com>
Diffstat (limited to 'src/xcb.h')
-rw-r--r--src/xcb.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/xcb.h b/src/xcb.h
index f951276..35d8768 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -285,6 +285,22 @@ xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
*/
xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie);
+/**
+ * @brief Discards the reply for a request.
+ * @param c: The connection to the X server.
+ * @param sequence: The request sequence number from a cookie.
+ *
+ * Discards the reply for a request. Additionally, any error generated
+ * by the request is also discarded (unless it was an _unchecked request
+ * and the error has already arrived).
+ *
+ * This function will not block even if the reply is not yet available.
+ *
+ * Note that the sequence really does have to come from an xcb cookie;
+ * this function is not designed to operate on socket-handoff replies.
+ */
+void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
+
/* xcb_ext.c */