xcb_query_extension(3)

πŸ“¦
version 1.17.0 Β· 4 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_query_extension β€” bestie, is that extension even here? πŸ’–

okay so this is the manual page for xcb_query_extension(3) and it's literally just "hey X server, do you have this extension??" energy. no cap. let's get into it 🫢


✨ NAME ✨

xcb_query_extension β€” check if extension is present


🌸 SYNOPSIS 🌸

#include <xcb/xproto.h>

πŸŽ€ Request function

xcb_query_extension_cookie_t xcb_query_extension(xcb_connection_t *conn,
       uint16_t name_len, const char *name);

πŸŽ€ Reply datastructure

typedef struct xcb_query_extension_reply_t {
    uint8_t  response_type;
    uint8_t  pad0;
    uint16_t sequence;
    uint32_t length;
    uint8_t  present;
    uint8_t  major_opcode;
    uint8_t  first_event;
    uint8_t  first_error;
} xcb_query_extension_reply_t;

πŸŽ€ Reply function

xcb_query_extension_reply_t
       *xcb_query_extension_reply(xcb_connection_t *conn,
       xcb_query_extension_cookie_t cookie, xcb_generic_error_t **e);

πŸ’… REQUEST ARGUMENTS πŸ’…

  • conn β€” your XCB connection to X11. the whole vibe check happens through this.
  • name_len β€” how long name is, in bytes. yes, bytes. count carefully bestie 😭
  • name β€” the name of the extension you're asking about, like "RANDR". and listen: this is case sensitive! "randr" is NOT "RANDR". she's picky. πŸ’…

πŸ¦‹ REPLY FIELDS πŸ¦‹

  • response_type β€” the type of this reply, and in this case it's XCB_QUERY_EXTENSION. this field is also chillin' in the xcb_generic_reply_t and you can use it to tell replies apart from each other. it's giving ✨name tag✨
  • sequence β€” the sequence number of the last request the X11 server processed.
  • length β€” the length of the reply, in words (and a word is 4 bytes, so do the math πŸ”₯).
  • present β€” whether the extension is actually present on this X11 server. the moment of truth πŸ‘‘
  • major_opcode β€” the major opcode for requests.
  • first_event β€” the first event code, if any.
  • first_error β€” the first error code, if any.

🌈 DESCRIPTION 🌈

Determines if the specified extension is present on this X11 server. that's the whole plot. 🎬

Every extension has a unique major_opcode to identify requests, and the minor opcodes plus request formats are extension-specific. if the extension provides events and errors, the first_event and first_error fields in the reply get set accordingly. iconic behavior honestly.

real talk: there should rarely be a need to use this request directly β€” XCB provides the xcb_get_extension_data function instead. use that one bestie, she's the shortcut 🫢

⭐ RETURN VALUE ⭐

Returns an xcb_query_extension_cookie_t. errors have to be handled when you call the reply function xcb_query_extension_reply.

If you want to handle errors in the event loop instead, use xcb_query_extension_unchecked. see xcb-requests(3) for details. two paths, pick your fighter ✨


πŸ’€ ERRORS πŸ’€

This request does never generate any errors. not one. zero. she's flawless, she's unbothered, she does not miss 😌


πŸ’œ SEE ALSO πŸ’œ


πŸ“ AUTHOR πŸ“

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. they really said "made by the machine, fixed by the people" fr fr πŸ™ˆ


okay that's the whole page, mwah πŸ’‹ this one came out of X Version 11, libxcb 1.17.0, and it's the xcb_query_extension(3) era of your life now. go query something. go be the main character. periodt. 🧚✨