XtGetDisplays(3)

πŸ’… XtGetDisplays β€” the <X11/Intrinsic.h> era, bestie edition

okay so this is a page from the XT FUNCTIONS manual, and it's all about XtGetDisplays β€” one little function that hands you back every display your app context is holding onto. short page, but it's lowkey important. let's go ✨


🌸 NAME 🌸

XtGetDisplays β€” retrieve a list of displays associated with an application context. that's the whole vibe: you have an app context, it has displays, you want the receipts. periodt.


✨ SYNTAX ✨

#include <X11/Intrinsic.h>

void XtGetDisplays(XtAppContext app_context, Display ***dpy_return,
       Cardinal* num_dpy_return);

look at that triple pointer. Display ***?? she's giving main character energy fr fr 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • app_context β€” Specifies the application context. you're telling her which app context to go snooping in πŸ’–
  • dpy_return β€” Returns a list of open X display connections in the specified application context. yes, it's a triple pointer, yes it's iconic, no we are not going to talk about it πŸ’…
  • num_dpy_return β€” Returns the count of open X display connections in dpy_return. so you know how many little display besties you just got handed πŸ¦‹

πŸ’€ DESCRIPTION πŸ’€

To free the list of displays, use XtFree.

that's it. that's the whole description. not me getting emotional over a three-word manpage πŸ₯Ή

but seriously bestie, don't forget the XtFree. that list is yours now β€” the function gave it to you, and nobody else is gonna clean it up. free the list, protect your memory, slay responsibly 🫢


🌈 SEE ALSO 🌈

  • X Toolkit Intrinsics - C Language Interface
  • Xlib - C Language X Interface

iykyk πŸ“š


and that's the whole page!! this one's from X Version 11, shipped with libXt 1.3.1, and the footer date stamp on the original is the same as the version block β€” so go forth, grab your displays, and XtFree them when you're done. mwah πŸ’‹πŸ‘‘

XtGetDisplays(3) β€” she's short, she's sweet, she leaks memory if you ignore her. no cap. πŸŽ€

πŸ“¦ where this page comes from