XpGetOneAttribute(3Xp)

πŸ’– NAME πŸ’–

Okay bestie, welcome to the XpGetOneAttribute(3Xp) page β€” manual name 3Xp, section XPRINT FUNCTIONS β€” and the short version is: XpGetOneAttribute gets a single print attribute from the specified print context. That's it. That's the whole assignment. ✨

🌈 SYNOPSIS 🌈

Compile vibes first, no cap:

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

char *XpGetOneAttribute ( display, context, type, attribute_name )
      Display *display;
      XPContext context;
      XPAttributes type;
      char *attribute_name;

πŸŽ€ ARGUMENTS πŸŽ€

  • display β€” specifies a pointer to the Display structure; returned from XOpenDisplay. πŸ‘‘
  • context β€” the print context from which the attribute pool is to be retrieved. 🫢
  • type β€” specifies the attribute pool. πŸ’…
  • attribute_name β€” the name of the attribute to be returned. πŸ¦‹

πŸ¦‹ DESCRIPTION πŸ¦‹

This request returns a COMPOUND_TEXT string attribute_value, else NULL if any errors occurred. Periodt. That's important: if something goes wrong, you get NULL, not a cute little error plushie. 😭

XpGetOneAttribute is a variation of XpGetAttributes to get a single attribute value from an attribute pool. Unlike XpGetAttributes, where the reply contains an entire attribute pool, XpGetOneAttribute returns just one attribute_value. It's giving "just the one, thanks" energy. ✨

One thing bestie: attribute_name should not include a colon. 🚫 The caller is expected to free the attribute value returned using XFree. Yes, that's your job. Free it. Do not ghost it. πŸ’…

⚠️ DIAGNOSTICS ⚠️

  • BadAlloc β€” insufficient memory. 😭
  • BadValue β€” the value specified for type is not valid. πŸ™ˆ
  • XPBadContext β€” the specified print context-id is not valid. πŸ’€

πŸ“ SEE ALSO πŸ“

XpGetAttributes(3Xp) β€” go read that too, bestie. πŸ’–


xoxo, bye bestie πŸ’‹ β€” footer source/version check: X Version 11, libXp 1.0.4. Date? Not in the footer, so I'm not inventing one β€” no cap. πŸŽ€

πŸ“¦ where this page comes from