summaryrefslogtreecommitdiff
path: root/src/xcb.h
diff options
context:
space:
mode:
authorChristian Linhart <chris@demorecorder.com>2015-04-29 09:11:37 +0200
committerChristian Linhart <chris@demorecorder.com>2015-04-08 11:55:48 +0200
commitcb621341a62e6d2233db3e337611f6fdd4f675a6 (patch)
treef50f034344e974fa95fe72274290abb8a5b3bbfd /src/xcb.h
parentc49aa985941112be05599032b9bb45b2652301ce (diff)
expose 64-bit sequence numbers for XLib
While XCB uses 64-bit sequence number internally, it only exposes "unsigned int" so that, on 32-bit architecture, Xlib based applications may see their sequence number wrap which causes the connection to the X server to be lost. Expose 64-bit sequence number from XCB API so that Xlib and others can use it even on 32-bit environment. This implies the following API addition: xcb_send_request64() xcb_discard_reply64() xcb_wait_for_reply64() xcb_poll_for_reply64() Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71338 Reviewed-by: Uli Schlachter <psychon@znc.in> Signed-off-by: Christian Linhart <chris@demorecorder.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'src/xcb.h')
-rw-r--r--src/xcb.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/xcb.h b/src/xcb.h
index 23fe74e..86eb1bc 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -378,6 +378,26 @@ xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t co
*/
void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
+/**
+ * @brief Discards the reply for a request, given by a 64bit sequence number
+ * @param c: The connection to the X server.
+ * @param sequence: 64-bit sequence number as returned by xcb_send_request64().
+ *
+ * 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 xcb_send_request64();
+ * the cookie sequence number is defined as "unsigned" int and therefore
+ * not 64-bit on all platforms.
+ * This function is not designed to operate on socket-handoff replies.
+ *
+ * Unlike its xcb_discard_reply() counterpart, the given sequence number is not
+ * automatically "widened" to 64-bit.
+ */
+void xcb_discard_reply64(xcb_connection_t *c, uint64_t sequence);
/* xcb_ext.c */