[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Programmer's Reference


MrmOpenHierarchyPerDisplay

Allocates a hierarchy ID and opens all the UID files in the hierarchy

Format

#include <Mrm/MrmPublic.h>
Cardinal MrmOpenHierarchyPerDisplay
Display
*displayMrmCount num_filesString
file_names_list[]MrmOsOpenParamPtr
*ancillary_structures_listMrmHierarchy
*hierarchy_id

DESCRIPTION

MrmOpenHierarchyPerDisplay allows you 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 MrmOpenHierarchyPerDisplay encounters any errors during its execution, any files that were opened are closed.

The application must call XtAppInitialize before calling MrmOpenHierarchyPerDisplay.

display
Specifies the connection to the X server and the value to pass to XtResolvePathname. For more information on the Display structure, see the Xlib function XOpenDisplay.

num_files
Specifies the number of files in the name list.

file_names_list
Specifies an array of character strings that identify the UID files.

ancillary_structures_list
A list of operating-system-dependent ancillary structures corresponding to items such as filenames, clobber flags, and so forth. This argument should be NULL for most operations. If you need to reference this structure, see the definition of MrmOsOpenParamPtr in the MrmPublic.h header file for more information.

hierarchy_id
Returns 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 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 is 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 searched first with %S mapped to .uid . If no file is found, it is searched again with %S mapped to NULL. For example, the following UIDPATH value and MrmOpenHierarchyPerDisplay 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;
  MrmOpenHierarchyPerDisplay((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 MrmOpenHierarchyPerDisplay, 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 display's language string is substituted for %L .

After MrmOpenHierarchyPerDisplay 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:

  1. 04:22:20S

  2. $XAPPLRESDIR/%L/uid/%N/04:22:20S

  3. $XAPPLRESDIR/%l/uid/%N/04:22:20S

  4. $XAPPLRESDIR/uid/%N/04:22:20S

  5. $XAPPLRESDIR/%L/uid/04:22:20S

  6. $XAPPLRESDIR/%l/uid/04:22:20S

  7. $XAPPLRESDIR/uid/04:22:20S

  8. $HOME/uid/04:22:20S

  9. $HOME/04:22:20S

  10. /usr/lib/X11/%L/uid/%N/04:22:20S

  11. /usr/lib/X11/%l/uid/%N/04:22:20S

  12. /usr/lib/X11/uid/%N/04:22:20S

  13. /usr/lib/X11/%L/uid/04:22:20S

  14. /usr/lib/X11/%l/uid/04:22:20S

  15. /usr/lib/X11/uid/04:22:20S

  16. /usr/include/X11/uid/04:22:20S
  17. If neither UIDPATH nor XAPPLRESDIR is set, MRM searches the following pathnames:

    1. 04:22:20S

    2. $HOME/%L/uid/%N/04:22:20S

    3. $HOME/%l/uid/%N/04:22:20S

    4. $HOME/uid/%N/04:22:20S

    5. $HOME/%L/uid/04:22:20S

    6. $HOME/%l/uid/04:22:20S

    7. $HOME/uid/04:22:20S

    8. $HOME/04:22:20S

    9. /usr/lib/X11/%L/uid/%N/04:22:20S

    10. /usr/lib/X11/%l/uid/%N/04:22:20S

    11. /usr/lib/X11/uid/%N/04:22:20S

    12. /usr/lib/X11/%L/uid/04:22:20S

    13. /usr/lib/X11/%l/uid/04:22:20S

    14. /usr/lib/X11/uid/04:22:20S

    15. /usr/include/X11/uid/04:22:20S
    16. These paths are defaults that vendors may change. For example, a vendor may use different directories for /usr/lib/X11 and /usr/include/X11 .

      The following substitutions are used in these paths:

      %U
      The UID file string, from the file_names_list argument.

      %N
      The class name of the application.

      %L
      The display's language string. This string is influenced by XtSetLanguageProc. The default string is determined by calling setlocale( LC_ALL, NULL) .

      %l
      The language component of the display's language string.

      %S
      The suffix to the filename. The entire path is first searched with a suffix of .uid . If no file is found, it is searched again with a NULL suffix.

      RETURN

      This function returns one of the following status return constants:

      MrmSUCCESS
      The function executed successfully.

      MrmNOT_FOUND
      File not found.

      MrmFAILURE
      The function failed.

      RELATED

      MrmCloseHierarchy (3).


      [ Previous | Next | Contents | Glossary | Home | Search ]