XpGetAttributes(3Xp)

πŸ’– NAME πŸ’–

XpGetAttributes β€” gets an attribute pool from the specified print context. This one is from the XPRINT FUNCTIONS chapter, page 3Xp, and it's basically here to hand you the whole attribute-pool vibe ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

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

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

πŸŽ€ ARGUMENTS πŸŽ€

  • display β€” a pointer to the Display structure, bestie; you get it back from XOpenDisplay.
  • context β€” the print context you're pulling the attribute pool out of.
  • type β€” specifies which attribute pool you want.

🌸 DESCRIPTION 🌸

XpGetAttributes returns a pool, which is a COMPOUND_TEXT resource string representing the attribute pool specified by type. The caller is expected to free pool when it's no longer needed, using XFree. Don't leave your girl hanging, okay? πŸ’…

The attribute pool β€” and therefore the resource string β€” consists of many name-value pairs (for example, "copy-count: 3"). The syntax of an attribute pool is the same as an X resource file (see "Resource File Syntax" in the Xlib specification).

Valid characters for each name (the left hand side) are derived from the Posix which is "a"-"z" and "A"="Z" and "0"-"9" and "_" and "-". Yes, the page really has that "A"="Z" moment β€” I'm copying it exactly, no cap πŸ’€

Valid characters for each value (the right hand side) are all characters except NULL and unescaped NEWLINE, though all predefined values in the X Print Service are confined to X Portable Character Set (XPCS) characters. Non-XPCS values are typically limited to localized "description" strings. See XpCreateContext regarding the locale hint for more information on localized values.

If any errors occur, XpGetAttributes returns NULL.


🧚 STRUCTURES 🧚

The values for the typedef XPAttributes in <X11/extensions/Print.h> are:

#define  XPJobAttr       1 /βˆ— get/set */
#define  XPDocAttr       2 /βˆ— get/set */
#define  XPPageAttr 3 /βˆ— get/set-subset of XPDocAttr */
#define  XPPrinterAttr   4 /βˆ— get only (library) */
#define  XPServerAttr    5 /βˆ— get only (library), no context needed */

πŸ”₯ DIAGNOSTICS πŸ”₯

  • BadAlloc β€” insufficient memory 😭
  • BadValue β€” the value specified for type is not valid
  • XPBadContext β€” the specified print context-id is not valid

πŸ“ FILES πŸ“

  • <X11/extensions/Print.h>

πŸ‘‘ SEE ALSO πŸ‘‘

  • XpCreateContext(3Xp)

okay that's the whole page, bestie β€” X Version 11, libXp 1.0.4, and the footer didn't give me a date to quote, so I'm not inventing one πŸŽ€πŸ’–

πŸ“¦ where this page comes from