MrmOpenHierarchy(Xm) UNIX System V
NAME
MrmOpenHierarchy - Allocates a hierarchy ID and opens all
the uid files in the hierarchy.
SYNOPSIS
#include <Xm/Intrinsics>
#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 will search in subsequent fetch
operations. All subsequent fetch operations will 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.
num_files Specifies the number of files in the name list.
file_names_list
Specifies an array of pointers to character
strings that identify the .uid files.
ancillary_structures_list
A list of operating system-dependent ancillary
structures corresponding to such things as file
names, 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_id
Returns the search hierarchy ID. The search
hierarchy ID identifies the list of .uid files
that MRM will search (in order) when performing
subsequent fetch calls.
Each uid file specified in file_names_list can specify
either a full directory pathname or a file name. If a uid
file does not specify the pathname it will not contain any
embedded slashes (/), and it will be accessed through the
UIDPATH environment variable.
The UIDPATH environment variable specifies search paths and
naming conventions associated with uid files. It can contain
the substitution fields %L and %N, where the current setting
of the LANG environment variable is substituted for %L and
the .uid name passed to MrmOpenHierarchy is substituted for
%N. For example, the following uid path and MrmOpenHierarchy
call would cause MRM to open two separate .uid files:
UIDPATH=/uidlib/%L/%N.uid:/uidlib/%N/%L
static char *uid_files[] = {"/usr/users/me/test.uid", "test2"};
MrmHierarchy *Hierarchy_id;
MrmOpenHierarchy((MrmCount)2,uid_files, NULL, Hierarchy_id)
The first file, /usr/users/me/test.uid, would be opened as
specified, as this file specification includes a pathname.
The second file, test2, would be looked for first in
/uidlib/$LANG/test2.uid, and second in /uidlib/test2/$LANG.
After MrmOpenHierarchy opens the uid hierarchy, you should
not delete or modify the uid files until you close the uid
hierarchy by calling MrmCloseHierarchy.
RETURN VALUE
This function returns one of these status return constants:
MrmSUCCESS The function executed successfully.
MrmNOTFOUND File not found.
MrmFAILURE The function failed.
RELATED INFORMATION
MrmCloseHierarchy(Xm)
(printed 2/14/90) MrmOpenHierarchy(Xm)