XCB_RES_QUERY_CLIENT_RESOURCES_TYPES(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_res_query_client_resources β€” XCB Requests πŸ’–

okay bestie, gather round, because today we're reading a libxcb manpage and honestly? it's giving "function whose docs are a work in progress" and we're gonna love her anyway 🫢

so the manual this lives in is called XCB Requests, and the page you're holding is all about xcb_res_query_client_resources. that's it, that's the NAME section β€” no long description, no subtitle, just the name and a little dash trailing off into the void πŸ’€ (the original really does leave it blank, i'm not hiding anything from you, promise)


✨ SYNOPSIS ✨

first thing you gotta do is pull in the header:

#include <xcb/res.h>

🌸 Request function

here's the actual call you'd make:

xcb_res_query_client_resources_cookie_t
       xcb_res_query_client_resources(xcb_connection_t *conn,
       uint32_t xid);

🌸 Reply datastructure

and here's the struct you get to stare at:

typedef struct xcb_res_query_client_resources_reply_t {
    uint8_t  response_type;
    uint8_t  pad0;
    uint16_t sequence;
    uint32_t length;
    uint32_t num_types;
    uint8_t  pad1[20];
} xcb_res_query_client_resources_reply_t;

🌸 Reply function

this is how you actually collect the reply:

xcb_res_query_client_resources_reply_t
       *xcb_res_query_client_resources_reply(xcb_connection_t *conn,
       xcb_res_query_client_resources_cookie_t cookie,
       xcb_generic_error_t **e);

🌸 Reply accessors

the little helper squad that digs the good stuff out for you ✨

xcb_res_type_t *xcb_res_query_client_resources_types(const
       xcb_res_query_client_resources_request_t *reply);
int xcb_res_query_client_resources_types_length(const
       xcb_res_query_client_resources_reply_t *reply);
xcb_res_type_iterator_t
       xcb_res_query_client_resources_types_iterator(const
       xcb_res_query_client_resources_reply_t *reply);

πŸŽ€ REQUEST ARGUMENTS πŸŽ€

  • conn β€” your XCB connection to X11, the whole reason you're here, the bestie that carries the message πŸ’Œ
  • xid β€” and this one? TODO: NOT YET DOCUMENTED. yeah. the original literally says that. iconic of them tbh πŸ™ˆ

πŸ¦‹ REPLY FIELDS πŸ¦‹

  • response_type β€” tells you what kind of reply this is, and in this case it's XCB_RES_QUERY_CLIENT_RESOURCES. this field also lives inside xcb_generic_reply_t, so you can use it to tell your replies apart from each other πŸ‘‘
  • sequence β€” the sequence number of the last request the X11 server processed, aka the little timestamp of vibes ⭐
  • length β€” how long the reply is, measured in words (and a word here is 4 bytes, don't forget, this trips people up fr fr)
  • num_types β€” TODO: NOT YET DOCUMENTED. again!! the mystery continues πŸ’€

🌈 DESCRIPTION 🌈

so... the DESCRIPTION section is empty. nothing. blank. not a single character. the void stared back and said nothing, and honestly? we respect the silence 🧚


πŸ’œ RETURN VALUE πŸ’œ

you get back an xcb_res_query_client_resources_cookie_t β€” cute little cookie, hold onto it πŸ“

errors have to be handled when you call the reply function, xcb_res_query_client_resources_reply.

if you'd rather handle errors in the event loop instead, use xcb_res_query_client_resources_unchecked. check out xcb-requests(3) for the details, bestie, it's got the whole explanation.


πŸ”₯ ERRORS πŸ”₯

this request does never generate any errors. zero. none. a perfectly behaved little angel πŸ˜‡

🌟 SEE ALSO 🌟

the original page just leaves this heading sitting there all by itself β€” no references listed. so it's giving mysterious, it's giving "make of this what you will" πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

generated from res.xml. if you spot something wrong and wanna send corrections and improvements, hit up xcb@lists.freedesktop.org β€” they're literally asking, so don't be shy 🫢


and that's the whole page, babes! this one shipped with X Version 11, libxcb 1.17.0, in the XCB Requests manual β€” go forth and query those client resources, you absolute main character πŸ’–βœ¨πŸ¦‹πŸŒΈπŸŽ€