MrmOpenHierarchy(3X) — Kubota Pacfic Computer Inc.
NAME
MrmOpenHierarchy − Allocates a hierarchy ID and opens all the UID files in the hierarchy.
SYNOPSIS
#include <Mrm/MrmPublic.h>
Cardinal MrmOpenHierarchy(num_files, file_names_list,
ancillary_structures_list, hierarchy_id)
MrmCount num_files;
String file_names_list[];
MrmOsOpenParamPtr ∗ancillary_structures_list;
MrmHierarchy ∗hierarchy_id;
DESCRIPTION
The MrmOpenHierarchy function allows the user to specify the list of UID files that MRM searches in subsequent fetch operations. All subsequent fetch operations return the first occurrence of the named item encountered while traversing the UID hierarchy from the first list element (UID file specification) to the last list element. This function also allocates a hierarchy ID and opens all the UID files in the hierarchy. It initializes the optimized search lists in the hierarchy. If MrmOpenHierarchy encounters any errors during its execution, any files that were opened are closed.
The application must call XtAppInitialize before calling MrmOpenHierarchy.
num_filesSpecifies the number of files in the name list.
file_names_listSpecifies an array of character strings that identify the UID files.
ancillary_structures_list
A list of operating-system-dependent ancillary structures corresponding to such things as filenames, clobber flag, and so forth. This argument should be NULL for most operations. If you need to reference this structure, see the definition of MrmOsOpenParamPtr in MrmPublic.h for more information.
hierarchy_idReturns the search hierarchy ID. The search hierarchy ID identifies the list of UID files that MRM searches (in order) when performing subsequent fetch calls.
Each UID file string in file_names_list can specify either a full pathname or a filename. If a UID file string has a leading slash (/), it specifies a full pathname, and MRM opens the file as specified. Otherwise, the UID file string specifies a filename. In this case MRM looks for the file along a search path specified by the UIDPATH environment variable or by a default search path, which varies depending on whether or not the XAPPLRESDIR environment variable is set. The filename is substituted for each occurrence of %U in the search path.
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 MrmOpenHierarchy is substituted for %U. It can also contain the substitution fields accepted by XtResolvePathname. 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 the UID file string in the file_names_list argument specifies a full pathname. MRM looks for the second file, test2, first as /uidlib/%L/test2.uid and second as /uidlib/test2/%L, where the current setting of the xnlLanguage resource or the LANG environment variable is substituted for %L.
After MrmOpenHierarchy opens the UID hierarchy, you should not delete or modify the UID files until you close the UID hierarchy by calling MrmCloseHierarchy.
If UIDPATH is not set but the environment variable XAPPLRESDIR is set, MRM searches the following pathnames: %U
$XAPPLRESDIR/%L/uid/%N/%U
$XAPPLRESDIR/%l/uid/%N/%U
$XAPPLRESDIR/uid/%N/%U
$XAPPLRESDIR/%L/uid/%U
$XAPPLRESDIR/%l/uid/%U
$XAPPLRESDIR/uid/%U
$HOME/uid/%U
$HOME/%U
/usr/lib/X11/%L/uid/%N/%U
/usr/lib/X11/%l/uid/%N/%U
/usr/lib/X11/uid/%N/%U
/usr/lib/X11/%L/uid/%U
/usr/lib/X11/%l/uid/%U
/usr/lib/X11/uid/%U
/usr/include/X11/uid/%U
If neither UIDPATH nor XAPPLRESDIR is set, MRM searches the following pathnames: %U
$HOME/%L/uid/%N/%U
$HOME/%l/uid/%N/%U
$HOME/uid/%N/%U
$HOME/%L/uid/%U
$HOME/%l/uid/%U
$HOME/uid/%U
$HOME/%U
/usr/lib/X11/%L/uid/%N/%U
/usr/lib/X11/%l/uid/%N/%U
/usr/lib/X11/uid/%N/%U
/usr/lib/X11/%L/uid/%U
/usr/lib/X11/%l/uid/%U
/usr/lib/X11/uid/%U
/usr/include/X11/uid/%U
The following substitutions are used in these paths:
%UThe UID file string, from the file_names_list argument.
%NThe class name of the application.
%LThe value of the xnlLanguage resource or the LANG environment variable.
%lThe language component of the xnlLanguage resource or the LANG environment variable.
RETURN VALUE
This function returns one of these status return constants:
MrmSUCCESSThe function executed successfully.
MrmNOT_FOUNDFile not found.
MrmFAILUREThe function failed.
RELATED INFORMATION
September 02, 1992