MRMOPENHIERARCHY(3)
πΈ MrmOpenHierarchy β the girlies' guide to opening a whole UID hierarchy π
okay bestie, this is MrmOpenHierarchy, a library call straight out of the Motif resource manager, and we're gonna get you fluent in it. no cap.
β¨ NAME β¨
MrmOpenHierarchy β allocates a hierarchy ID and opens all the UID files in the hierarchy π«Ά
β¨ SYNOPSIS β¨
#include <Mrm/MrmPublic.h>
Cardinal MrmOpenHierarchy(
MrmCount num_files,
String file_names_list[],
MrmOsOpenParamPtr *ancillary_structures_list,
MrmHierarchy *hierarchy_id);
β¨ DESCRIPTION β¨
so real talk first: this routine is obsolete π and it only exists for compatibility with previous releases. it got replaced by MrmOpenHierarchyPerDisplay. MrmOpenHierarchy is identical to MrmOpenHierarchyPerDisplay except that it doesn't take a display argument. that's the whole difference, periodt.
num_filesβ the number of files in the name list. count 'em, bestie.file_names_listβ an array of character strings that identify the UID files. this is your lineup πancillary_structures_listβ a list of operating-system-dependent ancillary structures matching things like filenames, clobber flags, and so forth. this argument should beNULLfor most operations. if you actually need to reference this structure, go read the definition ofMrmOsOpenParamPtrin theMrmPublic.hheader file for more info. iykyk.hierarchy_idβ returns the search hierarchy ID. this ID is the thing that identifies the list of UID files that MRM searches (in order!) when it's doing subsequent fetch calls. it's giving β¨receiptsβ¨
π¦ the pathname situation
every UID file string in file_names_list can be either a full pathname or just a filename. here's the vibe check:
- if a UID file string has a leading slash (
/), it's a full pathname, and MRM opens the file exactly as specified. no searching, no games. - otherwise, the string is a filename, and MRM goes looking for it along a search path. that path comes from the
UIDPATHenvironment variable, or from a default search path β and that default varies depending on whether or not theXAPPLRESDIRenvironment variable is set.
the UIDPATH environment variable specifies a search path and naming conventions associated with UID files. it can contain the substitution field %U, where the UID file string from the file_names_list argument to MrmOpenHierarchyPerDisplay gets substituted for %U. it can also contain the substitution fields accepted by XtResolvePathname. the substitution field %T is always mapped to uid. the entire path is first searched with %S mapped to .uid. if no file is found, it gets searched again with %S mapped to NULL.
β οΈ if no display is set prior to calling this function, the result of this function's call to XtResolvePathname is undefined. no display, no promises, bestie π
π the iconic example
for example, the following UIDPATH value and MrmOpenHierarchy call cause MRM to open two separate UID files:
UIDPATH=/uidlib/%L/%U.uid:/uidlib/%U/%L
static char *uid_files[] = {"/usr/users/me/test.uid", "test2"};
MrmHierarchy *Hierarchy_id;
MrmOpenHierarchy((MrmCount)2,uid_files, NULL, Hierarchy_id)
MRM opens the first file, /usr/users/me/test.uid, as specified in the file_names_list argument to MrmOpenHierarchy, because that UID file string specifies a full pathname. then MRM looks for the second file, test2, first as /uidlib/%L/test2.uid and second as /uidlib/test2/%L, where the display's language string is substituted for %L. slay β¨
π afterMrmOpenHierarchyopens the UID hierarchy, you should not delete or modify the UID files until you close the UID hierarchy by callingMrmCloseHierarchy. hands off, okay??
π default search paths: XAPPLRESDIR is set, UIDPATH is not
if UIDPATH is not set but the environment variable XAPPLRESDIR is set, MRM searches the following pathnames:
%U%S$XAPPLRESDIR/%L/uid/%N/%U%S$XAPPLRESDIR/%l/uid/%N/%U%S$XAPPLRESDIR/uid/%N/%U%S$XAPPLRESDIR/%L/uid/%U%S$XAPPLRESDIR/%l/uid/%U%S$XAPPLRESDIR/uid/%U%S$HOME/uid/%U%S$HOME/%U%S/usr/lib/X11/%L/uid/%N/%U%S/usr/lib/X11/%l/uid/%N/%U%S/usr/lib/X11/uid/%N/%U%S/usr/lib/X11/%L/uid/%U%S/usr/lib/X11/%l/uid/%U%S/usr/lib/X11/uid/%U%S/usr/include/X11/uid/%U%S
π default search paths: neither is set
if neither UIDPATH nor XAPPLRESDIR is set, MRM searches the following pathnames:
%U%SHOME/%L/uid/%N/%U%SHOME/%l/uid/%N/%U%S$HOME/uid/%N/%U%S$HOME/%L/uid/%U%S$HOME/%l/uid/%U%S$HOME/uid/%U%S$HOME/%U%S/usr/lib/X11/%L/uid/%N/%U%S/usr/lib/X11/%l/uid/%N/%U%S/usr/lib/X11/uid/%N/%U%S/usr/lib/X11/%L/uid/%U%S/usr/lib/X11/%l/uid/%U%S/usr/lib/X11/uid/%U%S/usr/include/X11/uid/%U%S
these paths are defaults that vendors may change. for example, a vendor may use different directories for /usr/lib/X11 and /usr/include/X11. so like, your mileage may vary, girly π
π§ the substitution fields, explained
%Uβ the UID file string, from thefile_names_listargument.%Nβ the class name of the application.%Lβ the display's language string. this string is influenced byXtSetLanguageProc. the default string is determined by callingsetlocale(LC_ALL, NULL).%lβ the language component of the display's language string. (lowercase l, bestie, don't mix them up π)%Sβ the suffix to the filename. the entire path is first searched with a suffix of.uid. if no file is found, it's searched again with aNULLsuffix.
β¨ RETURN β¨
this function returns one of the following status return constants:
MrmSUCCESSβ the function executed successfully. we ate and left no crumbs πMrmNOT_FOUNDβ file not found. π it's giving missing.MrmFAILUREβ the function failed. π
β¨ RELATED β¨
MrmOpenHierarchyPerDisplay(3) and MrmCloseHierarchy(3). go read those too, they're the main characters of this friend group π
mwah π that was the whole MrmOpenHierarchy(library call) page, literally all of it, no crumbs left behind β and yeah, the version/footer line down at the bottom was just the same MrmOpenHierarchy(library call) marker, so consider this your official sign-off, bestie. π
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms