Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not
be used in advertising or otherwise to promote the sale, use or other
dealing in this Software without prior written authorization from the
X Consortium.
char * XtResolvePathname(Display *display, const char *type, const char *filename, const char *suffix, const char *path, Substitution substitutions, Cardinal num_substitutions, XtFilePredicate predicate);
.ns
.ns
XtResolvePathname calls XtFindFile with the following substitutions in addition to any passed by the caller and returns the value returned by XtFindFile :
If a path is passed to XtResolvePathname , it will be passed along to XtFindFile . If the path argument is NULL, the value of the \s-1XFILESEARCHPATH\s+1 environment variable will be passed to XtFindFile . If \s-1XFILESEARCHPATH\s+1 is not defined, an implementation-specific default path will be used which contains at least 6 entries. These entries must contain the following substitutions:
1. %C, %N, %S, %T, %L or %C, %N, %S, %T, %l, %t, %c 2. %C, %N, %S, %T, %l 3. %C, %N, %S, %T 4. %N, %S, %T, %L or %N, %S, %T, %l, %t, %c 5. %N, %S, %T, %l 6. %N, %S, %TThe order of these six entries within the path must be as given above. The order and use of substitutions within a given entry is implementation dependent. If the path begins with a colon, it will be preceded by %N%S. If the path includes two adjacent colons, %N%S will be inserted between them.
The type parameter is intended to be a category of files, usually being translated into a directory in the pathname. Possible values might include \*(``app-defaults\*('', \*(``help\*('', and \*(``bitmap\*(''.
The suffix parameter is intended to be appended to the file name. Possible values might include \*(``.txt\*('', \*(``.dat\*('', and \*(``.bm\*(''.
A suggested value for the default path on POSIX-based systems is
__projectroot__/lib/X11/%L/%T/%N%C%S:__projectroot__/lib/X11/%l/%T/%N%C%S:\\__projectroot__/lib/X11/%T/%N%C%S:__projectroot__/lib/X11/%L/%T/%N%S:\\
__projectroot__/lib/X11/%l/%T/%N%S:__projectroot__/lib/X11/%T/%N%S
Using this example, if the user has specified a language, it will be used as a subdirectory of __projectroot__/lib/X11 that will be searched for other files. If the desired file is not found there, the lookup will be tried again using just the language part of the specification. If the file is not there, it will be looked for in __projectroot__/lib/X11. The type parameter is used as a subdirectory of the language directory or of __projectroot__/lib/X11, and suffix is appended to the file name.
The %D substitution allows the addition of path elements to the implementation-specific default path, typically to allow additional directories to be searched without preventing resources in the system directories from being found. For example, a user installing resource files under a directory called \*(``ourdir\*('' might set \s-1XFILESEARCHPATH\s+1 to
%D:ourdir/%T/%N%C:ourdir/%T/%NThe customization string is obtained by querying the resource database currently associated with the display (the database returned by XrmGetDatabase ) for the resource application_name.customization, class application_class.Customization where application_name and application_class are the values returned by XtGetApplicationNameAndClass . If no value is specified in the database, the empty string is used.
It is the responsibility of the caller to free the returned string using XtFree when it is no longer needed.
\*(xT
\*(xL