Details on using xcb_send_request()?

Junk Mail <ireallyhatespam-zJpx2rpV7r/[email protected]> Wed, 03 Feb 2021 23:47:31 +0000
Newsgroups gmane.comp.freedesktop.xcb
Message-ID <[email protected]>
Of course I could simply read what is written here https://gitlab.freedesktop.org/xorg/lib/libxcb/-/blob/master/src/xcbext.h#L62 but still, I felt the need for examples showing its usage and I found this:

https://github.com/StarchLinux/libxcb/blob/master/xproto.c#L1808

xcb_parts[2].iov_base = (char *) &xcb_out;xcb_parts[2].iov_len = sizeof(xcb_out);xcb_parts[3].iov_base = 0;xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; // why?xcb_parts[4].iov_base = (char *) value_list;xcb_parts[4].iov_len = xcb_popcount(value_mask) * sizeof(uint32_t);xcb_parts[5].iov_base = 0;xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; // why?

It seems like there are "delimiters" (index 3 and 5 of xcb_parts, which is of type struct iovec), and their lengths are always the negative value of the length of the previous index AND'd with 3, I have found nothing obvious that could shed light here: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/blob/master/src/xcb_out.c#L221

So if I read this code correctly, indexes 3 and 5 are sent directly to the X server, but I failed to find if this is something required by the X Window System protocol spec.

Could anyone shed light on this?

_______________________________________________
Xcb mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/xcb