XQueryExtension(3)
💖 NAME
okay so bestie, welcome to the X FUNCTIONS corner of the manual — this is XQueryExtension(3), and it’s lowkey the friend group that can list available extensions ✨
XQueryExtension,XListExtensions,XFreeExtensionList— list available extensions.
✨ SYNTAX
copy-paste core, no cap:
Bool XQueryExtension(display, name, major_opcode_return,
first_event_return, first_error_return)
char **XListExtensions(display, nextensions_return)
XFreeExtensionList(list)
🎀 ARGUMENTS
display— Specifies the connection to the X server. It’s giving “which server are we talking to” vibes.name— Specifies the extension name. This is the name you’re asking about, bestie.major_opcode_return— Returns the major opcode. That’s where the major opcode lands.first_event_return— Returns the first event code, if any. If there’s an event code, it goes here 🫶first_error_return— Returns the first error code, if any. If there’s an error code, this is its spot.nextensions_return— Returns the number of extensions listed. The count goes right here.list— Specifies the list of extension names. This is the list you’re handing over.
🦋 DESCRIPTION
okay so XQueryExtension is the vibe check: it determines if the named extension is present. If the extension is not present, XQueryExtension returns False; otherwise, it returns True — periodt. If the extension is present, XQueryExtension returns the major opcode for the extension to major_opcode_return; otherwise, it returns zero. Any minor opcode and the request formats are specific to the extension, iykyk. If the extension involves additional event types, XQueryExtension returns the base event type code to first_event_return; otherwise, it returns zero. The format of the events is specific to the extension. If the extension involves additional error codes, XQueryExtension returns the base error code to first_error_return; otherwise, it returns zero. The format of additional data in the errors is specific to the extension. If the extension name is not in the Host Portable Character Encoding the result is implementation-dependent 🫠. Uppercase and lowercase matter; the strings “thing”, “Thing”, and “thinG” are all considered different names, so do not try to make them match, bestie.
Then there’s XListExtensions: it returns a list of all extensions supported by the server 🌈. If the data returned by the server is in the Latin Portable Character Encoding, then the returned strings are in the Host Portable Character Encoding. Otherwise, the result is implementation-dependent. That’s the whole tea.
XFreeExtensionList is the cleanup bestie: it frees the memory allocated by XListExtensions. Literally do not skip this one — it’s giving responsible main character energy 💅.
okay bye bestie 🫶 this page is from X Version 11, libX11 1.8.14, and it’s the XQueryExtension(3) manual page — slay, you got this ✨
📦 where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 · X11
- arch rolling: libx11 1.8.14-1 · MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms