xcb_shm_query_version(3)

πŸ“¦
version 1.17.0 Β· 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– xcb_shm_query_version β€” bestie, what version of MIT-SHM are we even working with?? πŸ’–

okay so this is a page from the XCB Requests manual (section 3, we're fancy like that ✨), and it's all about xcb_shm_query_version. It's giving "hi X server, pls tell me what flavor of the MIT-SHM extension you're running" and honestly? iconic behavior. πŸŽ€


🌸 NAME 🌸

xcb_shm_query_version β€” Query the version of the MIT-SHM extension.

Like, that's it. That's the whole job. Go find out the version. πŸ’…


✨ SYNOPSIS ✨

#include <xcb/shm.h>

πŸ¦‹ Request function πŸ¦‹

xcb_shm_query_version_cookie_t
       xcb_shm_query_version(xcb_connection_t *conn,

πŸŽ€ Reply datastructure πŸŽ€

typedef struct xcb_shm_query_version_reply_t {
    uint8_t  response_type;
    uint8_t  shared_pixmaps;
    uint16_t sequence;
    uint32_t length;
    uint16_t major_version;
    uint16_t minor_version;
    uint16_t uid;
    uint16_t gid;
    uint8_t  pixmap_format;
    uint8_t  pad0[15];
} xcb_shm_query_version_reply_t;

🧚 Reply function 🧚

xcb_shm_query_version_reply_t
       *xcb_shm_query_version_reply(xcb_connection_t *conn,
       xcb_shm_query_version_cookie_t cookie, xcb_generic_error_t **e);

πŸ’œ REQUEST ARGUMENTS πŸ’œ

  • conn β€” The XCB connection to X11. literally just your connection to the server, your little chat thread with X. πŸ’Œ

🌈 REPLY FIELDS 🌈

okay bestie here's the tea the server sends back, field by field, no cap:

  • response_type β€” The type of this reply, in this case XCB_SHM_QUERY_VERSION. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other. it's the little name tag so you know which reply just walked in the room. πŸ‘‘
  • sequence β€” The sequence number of the last request processed by the X11 server. like a receipt number fr fr.
  • length β€” The length of the reply, in words (a word is 4 bytes). yes, words. not vibes. 4 bytes each. πŸ’€
  • shared_pixmaps β€” True if the server supports shared pixmaps, otherwise false. a simple yes/no, we love a boolean that commits. 🫢
  • major_version β€” The major version of the extension supported. the big number energy. πŸ”₯
  • minor_version β€” The minor version of the extension supported. the little number that tags along. πŸ“
  • uid β€” The UID of the server.
  • gid β€” The GID of the server.
  • pixmap_format β€” TODO: NOT YET DOCUMENTED. (the docs said "we'll get to it" and then never got to it. we've all been there πŸ™ˆ)

⭐ DESCRIPTION ⭐

This is used to determine the version of the MIT-SHM extension supported by the X server.

🚨 BIG IMPORTANT ONE, NO SKIPPING: Clients MUST NOT make other requests in this extension until a reply to this request indicates the X server supports them. like, do NOT run ahead. wait for the server to text back first. patience is a whole personality trait and here it's a requirement. πŸ’…

πŸ’– RETURN VALUE πŸ’–

Returns an xcb_shm_query_version_cookie_t. Errors have to be handled when calling the reply function xcb_shm_query_version_reply. so you get the cookie now, and the actual answer later when you come back for it. very "order at the counter, pick it up when they call your name." πŸŽ€

If you want to handle errors in the event loop instead, use xcb_shm_query_version_unchecked. See xcb-requests(3) for details. iykyk. ✨


πŸ‘‘ ERRORS πŸ‘‘

This request does never generate any errors. zero drama. not a single error to its name. we love a low-maintenance request. 🌸


πŸ”₯ SEE ALSO πŸ”₯


πŸ’œ AUTHOR πŸ’œ

Generated from shm.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.

like, if something's wrong, don't just side-eye it β€” email them. they're literally asking. 🫢


okay that's the whole page bestie, go query those versions responsibly ✨

signing off with the receipts: this one came out of X Version 11, libxcb 1.17.0, and it's filed under xcb_shm_query_version(3). mwah. πŸ’…πŸ’–πŸŽ€πŸ¦‹