MRMFETCHLITERAL(3)

πŸ“¦
version 2.3.8 Β· 3 versions
, in arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– MrmFetchLiteral πŸ’–

okay bestie, welcome to the MrmFetchLiteral glow-up page, straight out of the library call section of the manual. this is MrmFetchLiteral(3), and she is that girl: she reaches into a UID file and pulls out a literal (a named value) and its type. grab a snack, we're learning πŸ’…

✨ NAME ✨

MrmFetchLiteral β€” fetches a literal from a UID file πŸŽ€


🌸 SYNOPSIS 🌸

#include <Mrm/MrmPublic.h>
Cardinal MrmFetchLiteral(
MrmHierarchy hierarchy_id,
String index,
Display *display,
XtPointer *value,
MrmCode *type);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the MrmFetchLiteral function reads and returns the value and type of a literal (named value) that is stored as a public resource in a single UID file. it hands you back a pointer to the value of the literal, periodt. like, an integer is always returned as a pointer to an integer, and a string is always returned as a pointer to a string. consistency queen πŸ‘‘

bestie, listen: applications should not use MrmFetchLiteral for fetching icon or color literals. if you try it anyway? MrmFetchLiteral returns an error. it's giving "no ❀️". that is not her job, that's a whole other function's job.

here's the cast of characters, one by one πŸ’–

  • hierarchy_id β€” specifies the ID of the UID hierarchy that contains the specified literal. the value of hierarchy_id was returned in a previous call to MrmOpenHierarchyPerDisplay. so like, you already met her earlier, she's not new here.
  • index β€” specifies the UIL name of the literal (pixmap) to fetch. you must define this name in UIL as an exported value, no cap. if it's not exported, she can't find it, simple as that.
  • display β€” specifies the display used for the pixmap. the display argument specifies the connection to the X server. for more info on the Display structure, go look at the Xlib function XOpenDisplay. she's the plug for the server connection fr fr πŸ”Œ
  • value β€” returns the ID of the named literal's value. the function allocates space for the returned value, so the application is responsible for managing the allocated space by calling the appropriate deallocation function. for example, if the returned ID symbolizes a pixmap, then the application can recover the allocated space by calling XmDestroyPixmap. yeah bestie, you gotta clean up after yourself, that's the rules 🧹✨
  • type β€” returns the named literal's data type. types are defined in the include file Mrm/MrmPublic.h. go read the header, it's got the receipts πŸ“œ

πŸ‘‘ RETURN πŸ‘‘

this function returns one of the following status return constants, and honestly each one is a different mood:

  • MrmSUCCESS β€” the function executed successfully. ate and left no crumbs πŸ”₯
  • MrmBAD_HIERARCHY β€” the hierarchy ID was invalid. she doesn't know her 😭
  • MrmNOT_FOUND β€” the literal was not found in the UIL file. it's not there, babe, she looked πŸ’€
  • MrmWRONG_TYPE β€” the caller tried to fetch a literal of a type not supported by this function. wrong vibe, wrong function, respectfully πŸ™ˆ
  • MrmFAILURE β€” the function failed. sometimes things just don't work out, and that's the tea πŸ“

go read these next, they're all in the friend group:


and that's the whole page, bestie 🫢 this was MrmFetchLiteral from the library call manual, and yeah, the footer is literally just MrmFetchLiteral(library call) β€” no date, no version drama, she's timeless like that ⭐ go forth and fetch your literals responsibly πŸ’œ