1XtResolvePathname(3) XT FUNCTIONS XtResolvePathname(3)
2
3
4
6 XtResolvePathname - search for a file using standard substitution
7
9 #include <X11/Intrinsic.h>
10
11 char * XtResolvePathname(Display *display, const char *type, const char
12 *filename, const char *suffix, const char *path, Substitution
13 substitutions, Cardinal num_substitutions, XtFilePredicate pred‐
14 icate);
15
17 display Specifies the display to use to find the language for lan‐
18 guage substitutions.
19
20 type
21 filename
22 suffix Specify values to substitute into the path.
23
24 path Specifies the list of file specifications, or NULL.
25
26 substitutions
27 Specifies a list of additional substitutions to make into
28 the path, or NULL.
29
30 num_substitutions
31 Specifies the number of entries in substitutions.
32
33 predicate Specifies a procedure called to judge each potential file
34 name, or NULL.
35
37 The substitutions specified by XtResolvePathname are determined from
38 the value of the language string retrieved by XtDisplayInitialize for
39 the specified display. To set the language for all applications spec‐
40 ify ``*xnlLanguage: lang'' in the resource database. The format and
41 content of the language string are implementation-defined. One sug‐
42 gested syntax is to compose the language string of three parts; a
43 ``language part'', a ``territory part'' and a ``codeset part''. The
44 manner in which this composition is accomplished is implementation-
45 defined and the Intrinsics make no interpretation of the parts other
46 than to use them in substitutions as described below.
47
48 XtResolvePathname calls XtFindFile with the following substitutions in
49 addition to any passed by the caller and returns the value returned by
50 XtFindFile:
51
52 %N The value of the filename parameter, or the application's class
53 name if filename is NULL.
54
55 %T The value of the type parameter.
56
57 %S The value of the suffix parameter.
58
59 %L The language string associated with the specified display.
60
61 %l The language part of the display's language string.
62
63 %t The territory part of the display's language string.
64
65 %c The codeset part of the display's language string.
66
67 %C The customization string retrieved from the resource database
68 associated with display.
69
70 %D The value of the implementation-specific default path.
71
72 If a path is passed to XtResolvePathname, it will be passed along to
73 XtFindFile. If the path argument is NULL, the value of the XFILE‐
74 SEARCHPATH environment variable will be passed to XtFindFile. If
75 XFILESEARCHPATH is not defined, an implementation-specific default path
76 will be used which contains at least 6 entries. These entries must
77 contain the following substitutions:
78
79 1. %C, %N, %S, %T, %L or %C, %N, %S, %T, %l, %t, %c
80 2. %C, %N, %S, %T, %l
81 3. %C, %N, %S, %T
82 4. %N, %S, %T, %L or %N, %S, %T, %l, %t, %c
83 5. %N, %S, %T, %l
84 6. %N, %S, %T
85
86 The order of these six entries within the path must be as given above.
87 The order and use of substitutions within a given entry is implementa‐
88 tion dependent. If the path begins with a colon, it will be preceded
89 by %N%S. If the path includes two adjacent colons, %N%S will be
90 inserted between them.
91
92 The type parameter is intended to be a category of files, usually being
93 translated into a directory in the pathname. Possible values might
94 include ``app-defaults'', ``help'', and ``bitmap''.
95
96 The suffix parameter is intended to be appended to the file name. Pos‐
97 sible values might include ``.txt'', ``.dat'', and ``.bm''.
98
99 A suggested value for the default path on POSIX-based systems is
100
101 /usr/lib/X11/%L/%T/%N%C%S:/usr/lib/X11/%l/%T/%N%C%S:\
102 /usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%L/%T/%N%S:\
103 /usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S
104
105 Using this example, if the user has specified a language, it will be
106 used as a subdirectory of /usr/lib/X11 that will be searched for other
107 files. If the desired file is not found there, the lookup will be
108 tried again using just the language part of the specification. If the
109 file is not there, it will be looked for in /usr/lib/X11. The type
110 parameter is used as a subdirectory of the language directory or of
111 /usr/lib/X11, and suffix is appended to the file name.
112
113 The %D substitution allows the addition of path elements to the imple‐
114 mentation-specific default path, typically to allow additional directo‐
115 ries to be searched without preventing resources in the system directo‐
116 ries from being found. For example, a user installing resource files
117 under a directory called ``ourdir'' might set XFILESEARCHPATH to
118
119 %D:ourdir/%T/%N%C:ourdir/%T/%N
120
121 The customization string is obtained by querying the resource database
122 currently associated with the display (the database returned by XrmGet‐
123 Database) for the resource application_name.customization, class appli‐
124 cation_class.Customization where application_name and application_class
125 are the values returned by XtGetApplicationNameAndClass. If no value
126 is specified in the database, the empty string is used.
127
128 It is the responsibility of the caller to free the returned string
129 using XtFree when it is no longer needed.
130
132 X Toolkit Intrinsics - C Language Interface
133 Xlib - C Language X Interface
134
135
136
137X Version 11 libXt 1.1.5.1 XtResolvePathname(3)