DPMSQueryExtension(3)

πŸ’– DPMSQueryExtension(3) πŸ’–

okay bestie, welcome to DPMSQueryExtension from the X FUNCTIONS corner of the universe 🌈 this one's a little detective mission and it's honestly so iconic of it


✨ NAME ✨

DPMSQueryExtension β€” the lil function that goes and asks the X server whether the DPMS Extension is even a thing around here πŸ‘€


πŸŽ€ SYNOPSIS πŸŽ€

cc [ flag ... ] file ... -lXext [ library ... ]
#include <X11/extensions/dpms.h>

Bool DPMSQueryExtension
       (
             Display *display,
             int *event_base,
             int *error_base
       );

like, yes, that's the whole vibe. compile it, link it with -lXext, include the header, boom πŸ’…


🫢 ARGUMENTS 🫢

  • display β€” the connection to the X server, aka your lil phone line to the server, the whole relationship fr
  • event_base β€” where you want the assigned base event dropped off. it's a return location, so hand it a pointer and it'll fill it in πŸ“¬
  • error_base β€” same deal, but for the assigned base error. also a return location, also needs a pointer 🎁

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way that DPMSQueryExtension works is: it slides into the X server's DMs and asks, hey, is the Display Power Management Signaling (DPMS) Extension available? πŸ’¬

if the extension is available, it returns TRUE, and event_base and error_base get set to the base event and error numbers, respectively. slay ✨

otherwise the return value is FALSE, and β€” and this is the important part β€” the values of event_base and error_base are undefined. like, do not trust them, do not read them, do not make plans with them πŸ™ˆ


πŸ‘‘ RETURN VALUES πŸ‘‘

  • TRUE β€” DPMSQueryExtension returns TRUE if the extension is available, and event_base and error_base are set to the base event number and base error number for the extension, respectively. bestie ate and left no crumbs πŸ’–
  • FALSE β€” DPMSQueryExtension returns FALSE if extension is not available, and the values of event_base and error_base are undefined. no cap, undefined is undefined, don't go poking at them 😭

🌸 SEE ALSO 🌸


okay that's the whole page, you understood it perfectly, main character energy 🧚 and a cute lil sign-off for the credits: this one's from X Version 11, shipping with libXext 1.3.6, filed under DPMSQueryExtension(3) πŸ’œ periodt.

πŸ“¦ where this page comes from