blob: 83117edcbfaf9a0ffe1aa6683e331733dd1828f2 [file] [log] [blame]
Jack Jansen42218ce1997-01-31 16:15:11 +00001/***********************************************************
2Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI or Corporation for National Research Initiatives or
13CNRI not be used in advertising or publicity pertaining to
14distribution of the software without specific, written prior
15permission.
16
17While CWI is the initial source for this software, a modified version
18is made available by the Corporation for National Research Initiatives
19(CNRI) at the Internet address ftp://ftp.python.org.
20
21STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28PERFORMANCE OF THIS SOFTWARE.
29
30******************************************************************/
31
Jack Jansen12fce3e1995-08-14 12:31:44 +000032#include "Python.h"
33#include "osdefs.h"
Jack Jansen3f7d2b41996-09-06 22:21:07 +000034#include "macglue.h"
Jack Jansen41e25cc2000-07-14 22:16:01 +000035#include "macdefs.h"
Jack Jansen12fce3e1995-08-14 12:31:44 +000036#include "pythonresources.h"
Jack Jansen9ae898b2000-07-11 21:16:03 +000037#ifdef HAVE_UNISTD_H
38#include <unistd.h>
39#endif
Jack Jansen12fce3e1995-08-14 12:31:44 +000040
41
42/* Return the initial python search path. This is called once from
43** initsys() to initialize sys.path.
44**
45** If USE_BUILTIN_PATH is defined the path defined here is used
46** (after prepending the python home dir to each item).
47** If it is not defined the path is gotten from a resource in the
48** Preferences file.
49**
50** XXXX This code needs cleaning up. The routines here have moved
51** around quite a bit, and they're pretty messy for that reason.
52*/
53
54#include <Files.h>
55#include <Aliases.h>
56#include <Folders.h>
57#include <Resources.h>
58#include <TextUtils.h>
Jack Jansenb39be211995-09-01 11:48:10 +000059#include <Dialogs.h>
Jack Jansen12fce3e1995-08-14 12:31:44 +000060
Jack Jansen2d1306b2000-04-07 09:10:49 +000061#ifdef USE_GUSI1
Jack Jansen3f7d2b41996-09-06 22:21:07 +000062#include <GUSI.h>
63#endif
64
Jack Jansen9ae898b2000-07-11 21:16:03 +000065#ifndef USE_BUILTIN_PATH
66staticforward char *PyMac_GetPythonPath();
67#endif
68
Jack Jansen12fce3e1995-08-14 12:31:44 +000069#define PYTHONPATH "\
70:\n\
71:Lib\n\
72:Lib:stdwin\n\
73:Lib:test\n\
74:Lib:mac"
75
Jack Jansenac82b6a1998-07-13 13:38:29 +000076static int
Jack Jansen83c74df1996-10-22 15:25:42 +000077getpreffilefss(FSSpec *fssp)
78{
79 static int diditbefore=0;
Jack Jansenac82b6a1998-07-13 13:38:29 +000080 static int rv = 1;
Jack Jansen83c74df1996-10-22 15:25:42 +000081 static FSSpec fss;
Jack Jansenabdf93c1998-07-31 09:33:28 +000082 short prefdirRefNum;
83 long prefdirDirID;
Just van Rossum26a69db1999-02-02 15:49:03 +000084 long pyprefdirDirID;
Jack Jansenabdf93c1998-07-31 09:33:28 +000085 Handle namehandle;
Just van Rossum26a69db1999-02-02 15:49:03 +000086 OSErr err;
Jack Jansenabdf93c1998-07-31 09:33:28 +000087
88 if ( !diditbefore ) {
Jack Jansenabdf93c1998-07-31 09:33:28 +000089 if ( (namehandle=GetNamedResource('STR ', PREFFILENAME_NAME)) == NULL ) {
90 (void)StopAlert(NOPREFNAME_ID, NULL);
91 exit(1);
92 }
93
Jack Jansenabdf93c1998-07-31 09:33:28 +000094 if ( **namehandle == '\0' ) {
95 /* Empty string means don't use preferences file */
96 rv = 0;
97 } else {
98 /* There is a filename, construct the fsspec */
Just van Rossum26a69db1999-02-02 15:49:03 +000099 if ( FindFolder(kOnSystemDisk, 'pref', kDontCreateFolder, &prefdirRefNum,
100 &prefdirDirID) != noErr ) {
101 /* Something wrong with preferences folder */
102 (void)StopAlert(NOPREFDIR_ID, NULL);
103 exit(1);
104 }
105 /* make fsspec for the "Python" folder inside the prefs folder */
106 err = FSMakeFSSpec(prefdirRefNum, prefdirDirID, "\pPython", &fss);
107 if (err == fnfErr) {
108 /* it doesn't exist: create it */
109 err = FSpDirCreate(&fss, smSystemScript, &pyprefdirDirID);
110 } else {
111 /* it does exist, now find out the dirID of the Python prefs folder, brrr. */
112 CInfoPBRec info;
113 info.dirInfo.ioVRefNum = fss.vRefNum;
114 info.dirInfo.ioDrDirID = fss.parID;
115 info.dirInfo.ioNamePtr = fss.name;
116 info.dirInfo.ioFDirIndex = 0;
117 info.dirInfo.ioACUser = 0;
118 err = PBGetCatInfo(&info, 0);
119 if (err == noErr) {
120 pyprefdirDirID = info.dirInfo.ioDrDirID;
121 }
122 }
123 if (err != noErr) {
124 (void)StopAlert(NOPREFDIR_ID, NULL);
125 exit(1);
126 }
127 HLock(namehandle);
128 err = FSMakeFSSpec(fss.vRefNum, pyprefdirDirID, (unsigned char *)*namehandle, &fss);
129 HUnlock(namehandle);
130 if (err != noErr && err != fnfErr) {
131 (void)StopAlert(NOPREFDIR_ID, NULL);
132 exit(1);
133 }
Jack Jansenac82b6a1998-07-13 13:38:29 +0000134 }
Jack Jansen83c74df1996-10-22 15:25:42 +0000135 ReleaseResource(namehandle);
136 diditbefore = 1;
137 }
138 *fssp = fss;
Jack Jansenac82b6a1998-07-13 13:38:29 +0000139 return rv;
Jack Jansen83c74df1996-10-22 15:25:42 +0000140}
Jack Jansen12fce3e1995-08-14 12:31:44 +0000141
142char *
Jack Jansena547dca1996-07-10 15:48:25 +0000143Py_GetPath()
Jack Jansen12fce3e1995-08-14 12:31:44 +0000144{
145 /* Modified by Jack to do something a bit more sensible:
146 ** - Prepend the python home-directory (which is obtained from a Preferences
147 ** resource)
148 ** - Add :
149 */
150 static char *pythonpath;
Jack Jansen12fce3e1995-08-14 12:31:44 +0000151 char *p, *endp;
152 int newlen;
Jack Jansen83c74df1996-10-22 15:25:42 +0000153 char *curwd;
Jack Jansen12fce3e1995-08-14 12:31:44 +0000154
155 if ( pythonpath ) return pythonpath;
Jack Jansen12fce3e1995-08-14 12:31:44 +0000156#ifndef USE_BUILTIN_PATH
Jack Jansen83c74df1996-10-22 15:25:42 +0000157 if ( pythonpath = PyMac_GetPythonPath() )
Jack Jansen12fce3e1995-08-14 12:31:44 +0000158 return pythonpath;
159 printf("Warning: No pythonpath resource found, using builtin default\n");
160#endif
Jack Jansen83c74df1996-10-22 15:25:42 +0000161 curwd = PyMac_GetPythonDir();
Jack Jansen12fce3e1995-08-14 12:31:44 +0000162 p = PYTHONPATH;
163 endp = p;
164 pythonpath = malloc(2);
165 if ( pythonpath == NULL ) return PYTHONPATH;
166 strcpy(pythonpath, ":");
167 while (*endp) {
168 endp = strchr(p, '\n');
169 if ( endp == NULL )
170 endp = p + strlen(p);
171 newlen = strlen(pythonpath) + 1 + strlen(curwd) + (endp-p);
172 pythonpath = realloc(pythonpath, newlen+1);
173 if ( pythonpath == NULL ) return PYTHONPATH;
174 strcat(pythonpath, "\n");
175 if ( *p == ':' ) {
176 p++;
177 strcat(pythonpath, curwd);
178 strncat(pythonpath, p, (endp-p));
179 newlen--; /* Ok, ok, we've allocated one byte too much */
180 } else {
181 /* We've allocated too much in this case */
182 newlen -= strlen(curwd);
183 pythonpath = realloc(pythonpath, newlen+1);
184 if ( pythonpath == NULL ) return PYTHONPATH;
185 strncat(pythonpath, p, (endp-p));
186 }
187 pythonpath[newlen] = '\0';
188 p = endp + 1;
189 }
190 return pythonpath;
191}
192
Jack Jansen83c74df1996-10-22 15:25:42 +0000193
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000194/*
195** Open/create the Python Preferences file, return the handle
196*/
Jack Jansenee081042000-04-21 23:53:37 +0000197short
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000198PyMac_OpenPrefFile()
199{
Jack Jansenabdf93c1998-07-31 09:33:28 +0000200 AliasHandle handle;
201 FSSpec dirspec;
202 short prefrh;
203 OSErr err;
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000204
Jack Jansenac82b6a1998-07-13 13:38:29 +0000205 if ( !getpreffilefss(&dirspec))
206 return -1;
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000207 prefrh = FSpOpenResFile(&dirspec, fsRdWrShPerm);
208 if ( prefrh < 0 ) {
Jack Jansen83c74df1996-10-22 15:25:42 +0000209#if 0
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000210 action = CautionAlert(NOPREFFILE_ID, NULL);
211 if ( action == NOPREFFILE_NO )
212 exit(1);
Jack Jansen83c74df1996-10-22 15:25:42 +0000213#endif
Jack Jansen532e3c21996-02-21 15:36:26 +0000214 FSpCreateResFile(&dirspec, 'Pyth', 'pref', 0);
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000215 prefrh = FSpOpenResFile(&dirspec, fsRdWrShPerm);
216 if ( prefrh == -1 ) {
217 /* This "cannot happen":-) */
Jack Jansenb39be211995-09-01 11:48:10 +0000218 printf("Cannot create preferences file, error %d\n", ResError());
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000219 exit(1);
220 }
Jack Jansen26ee1261996-11-09 18:45:18 +0000221 if ( (err=PyMac_init_process_location()) != 0 ) {
222 printf("Cannot get application location, error %d\n", err);
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000223 exit(1);
224 }
Jack Jansen26ee1261996-11-09 18:45:18 +0000225 dirspec = PyMac_ApplicationFSSpec;
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000226 dirspec.name[0] = 0;
Jack Jansenb39be211995-09-01 11:48:10 +0000227 if ((err=NewAlias(NULL, &dirspec, &handle)) != 0 ) {
228 printf("Cannot make alias to application directory, error %d\n", err);
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000229 exit(1);
230 }
Jack Jansenabdf93c1998-07-31 09:33:28 +0000231 AddResource((Handle)handle, 'alis', PYTHONHOME_ID, "\p");
232 UpdateResFile(prefrh);
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000233
234 } else {
235 UseResFile(prefrh);
236 }
237 return prefrh;
238}
Jack Jansen12fce3e1995-08-14 12:31:44 +0000239
240/*
241** Return the name of the Python directory
242*/
Jack Jansen5b3c9711997-09-08 13:22:49 +0000243char *
Jack Jansen12fce3e1995-08-14 12:31:44 +0000244PyMac_GetPythonDir()
245{
Jack Jansen83c74df1996-10-22 15:25:42 +0000246 static int diditbefore = 0;
Jack Jansenabdf93c1998-07-31 09:33:28 +0000247 static char name[256] = {':', '\0'};
248 AliasHandle handle;
249 FSSpec dirspec;
250 Boolean modified = 0;
251 short oldrh, prefrh = -1, homerh;
252
253 if ( diditbefore )
254 return name;
255
256 oldrh = CurResFile();
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000257
Jack Jansenabdf93c1998-07-31 09:33:28 +0000258 /* First look for an override in the application file */
259 UseResFile(PyMac_AppRefNum);
260 handle = (AliasHandle)Get1Resource('alis', PYTHONHOMEOVERRIDE_ID);
261 UseResFile(oldrh);
262 if ( handle != NULL ) {
263 homerh = PyMac_AppRefNum;
264 } else {
265 /* Try to open preferences file in the preferences folder. */
266 prefrh = PyMac_OpenPrefFile();
267 handle = (AliasHandle)Get1Resource('alis', PYTHONHOME_ID);
268 if ( handle == NULL ) {
269 /* (void)StopAlert(BADPREFFILE_ID, NULL); */
270 diditbefore=1;
271 return ":";
272 }
273 homerh = prefrh;
274 }
275 /* It exists. Resolve it (possibly updating it) */
276 if ( ResolveAlias(NULL, handle, &dirspec, &modified) != noErr ) {
277 (void)StopAlert(BADPREFFILE_ID, NULL);
278 diditbefore=1;
279 return ":";
280 }
281 if ( modified ) {
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000282 ChangedResource((Handle)handle);
Jack Jansenabdf93c1998-07-31 09:33:28 +0000283 UpdateResFile(homerh);
284 }
285 if ( prefrh != -1 ) CloseResFile(prefrh);
286 UseResFile(oldrh);
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000287
Jack Jansen26ee1261996-11-09 18:45:18 +0000288 if ( PyMac_GetFullPath(&dirspec, name) == 0 ) {
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000289 strcat(name, ":");
Jack Jansenabdf93c1998-07-31 09:33:28 +0000290 } else {
Jack Jansen41fa7ea1995-08-31 13:59:36 +0000291 /* If all fails, we return the current directory */
292 printf("Python home dir exists but I cannot find the pathname!!\n");
Jack Jansen12fce3e1995-08-14 12:31:44 +0000293 name[0] = 0;
294 (void)getwd(name);
295 }
Jack Jansen83c74df1996-10-22 15:25:42 +0000296 diditbefore = 1;
Jack Jansen12fce3e1995-08-14 12:31:44 +0000297 return name;
298}
299
300#ifndef USE_BUILTIN_PATH
Jack Jansen5b3c9711997-09-08 13:22:49 +0000301char *
Jack Jansen9ae898b2000-07-11 21:16:03 +0000302PyMac_GetPythonPath(void)
Jack Jansen12fce3e1995-08-14 12:31:44 +0000303{
Jack Jansenabdf93c1998-07-31 09:33:28 +0000304 short oldrh, prefrh = -1;
305 char *rv;
306 int i, newlen;
307 Str255 pathitem;
308 int resource_id;
309 OSErr err;
310 Handle h;
311
312 oldrh = CurResFile();
313 /*
314 ** This is a bit tricky. We check here whether the application file
315 ** contains an override. This is to forestall us finding another STR# resource
316 ** with "our" id and using that for path initialization
317 */
318 UseResFile(PyMac_AppRefNum);
319 SetResLoad(0);
320 if ( (h=Get1Resource('STR#', PYTHONPATHOVERRIDE_ID)) ) {
321 ReleaseResource(h);
322 resource_id = PYTHONPATHOVERRIDE_ID;
323 } else {
324 resource_id = PYTHONPATH_ID;
325 }
326 SetResLoad(1);
327 UseResFile(oldrh);
328
329 /* Open the preferences file only if there is no override */
330 if ( resource_id != PYTHONPATHOVERRIDE_ID )
331 prefrh = PyMac_OpenPrefFile();
332 /* At this point, we may or may not have the preferences file open, and it
333 ** may or may not contain a sys.path STR# resource. We don't care, if it doesn't
334 ** exist we use the one from the application (the default).
335 ** We put an initial '\n' in front of the path that we don't return to the caller
336 */
337 if( (rv = malloc(2)) == NULL )
338 goto out;
339 strcpy(rv, "\n");
Jack Jansenf12e7091996-09-05 15:19:24 +0000340
Jack Jansenabdf93c1998-07-31 09:33:28 +0000341 for(i=1; ; i++) {
342 GetIndString(pathitem, resource_id, i);
343 if( pathitem[0] == 0 )
344 break;
345 if ( pathitem[0] >= 9 && strncmp((char *)pathitem+1, "$(PYTHON)", 9) == 0 ) {
346 /* We have to put the directory in place */
347 char *dir = PyMac_GetPythonDir();
348
349 newlen = strlen(rv) + strlen(dir) + (pathitem[0]-9) + 2;
350 if( (rv=realloc(rv, newlen)) == NULL)
351 goto out;
352 strcat(rv, dir);
353 /* Skip a colon at the beginning of the item */
354 if ( pathitem[0] > 9 && pathitem[1+9] == ':' ) {
Jack Jansen12fce3e1995-08-14 12:31:44 +0000355 memcpy(rv+strlen(rv), pathitem+1+10, pathitem[0]-10);
356 newlen--;
357 } else {
358 memcpy(rv+strlen(rv), pathitem+1+9, pathitem[0]-9);
359 }
Jack Jansenabdf93c1998-07-31 09:33:28 +0000360 rv[newlen-2] = '\n';
361 rv[newlen-1] = 0;
362 } else if ( pathitem[0] >= 14 && strncmp((char *)pathitem+1, "$(APPLICATION)", 14) == 0 ) {
363 /* This is the application itself */
Jack Jansena486a551996-04-04 15:39:18 +0000364
Jack Jansenabdf93c1998-07-31 09:33:28 +0000365 if ( (err=PyMac_init_process_location()) != 0 ) {
Jack Jansen26ee1261996-11-09 18:45:18 +0000366 printf("Cannot get application location, error %d\n", err);
Jack Jansena486a551996-04-04 15:39:18 +0000367 exit(1);
368 }
Jack Jansen26ee1261996-11-09 18:45:18 +0000369
370 newlen = strlen(rv) + strlen(PyMac_ApplicationPath) + 2;
Jack Jansenabdf93c1998-07-31 09:33:28 +0000371 if( (rv=realloc(rv, newlen)) == NULL)
372 goto out;
373 strcpy(rv+strlen(rv), PyMac_ApplicationPath);
374 rv[newlen-2] = '\n';
375 rv[newlen-1] = 0;
Jack Jansena486a551996-04-04 15:39:18 +0000376
Jack Jansenabdf93c1998-07-31 09:33:28 +0000377 } else {
378 /* Use as-is */
379 newlen = strlen(rv) + (pathitem[0]) + 2;
380 if( (rv=realloc(rv, newlen)) == NULL)
381 goto out;
382 memcpy(rv+strlen(rv), pathitem+1, pathitem[0]);
383 rv[newlen-2] = '\n';
384 rv[newlen-1] = 0;
385 }
Jack Jansen12fce3e1995-08-14 12:31:44 +0000386 }
387 if( strlen(rv) == 1) {
388 free(rv);
389 rv = NULL;
390 }
391 if ( rv ) {
392 rv[strlen(rv)-1] = 0;
393 rv++;
394 }
395out:
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000396 if ( prefrh != -1) CloseResFile(prefrh);
397 UseResFile(oldrh);
Jack Jansen12fce3e1995-08-14 12:31:44 +0000398 return rv;
399}
400#endif /* !USE_BUILTIN_PATH */
401
Jack Jansena4b7e141996-02-21 16:46:57 +0000402void
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000403PyMac_PreferenceOptions(PyMac_PrefRecord *pr)
Jack Jansena4b7e141996-02-21 16:46:57 +0000404{
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000405 short oldrh, prefrh = -1;
Jack Jansena4b7e141996-02-21 16:46:57 +0000406 Handle handle;
407 int size;
Jack Jansen5b3c9711997-09-08 13:22:49 +0000408 PyMac_PrefRecord *p;
409 int action;
Jack Jansena4b7e141996-02-21 16:46:57 +0000410
411
Jack Jansenabdf93c1998-07-31 09:33:28 +0000412 oldrh = CurResFile();
413
414 /* Attempt to load overrides from application */
415 UseResFile(PyMac_AppRefNum);
416 handle = Get1Resource('Popt', PYTHONOPTIONSOVERRIDE_ID);
417 UseResFile(oldrh);
418
419 /* Otherwise get options from prefs file or any other open resource file */
420 if ( handle == NULL ) {
421 prefrh = PyMac_OpenPrefFile();
422 handle = GetResource('Popt', PYTHONOPTIONS_ID);
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000423 }
Jack Jansenabdf93c1998-07-31 09:33:28 +0000424 if ( handle == NULL ) {
425 return;
426 }
427 HLock(handle);
428 size = GetHandleSize(handle);
429 p = (PyMac_PrefRecord *)*handle;
430 if ( p->version == POPT_VERSION_CURRENT && size == sizeof(PyMac_PrefRecord) ) {
431 *pr = *p;
432 } else {
433 action = CautionAlert(BADPREFERENCES_ID, NULL);
434 if ( action == BADPREF_DELETE ) {
435 OSErr err;
436
437 RemoveResource(handle);
438 if ( (err=ResError()) ) printf("RemoveResource: %d\n", err);
439 if ( prefrh != -1 ) {
440 UpdateResFile(prefrh);
441 if ( (err=ResError()) ) printf("UpdateResFile: %d\n", err);
442 }
443 } else if ( action == BADPREF_QUIT )
444 exit(1);
445 }
446 HUnlock(handle);
Jack Jansena4b7e141996-02-21 16:46:57 +0000447
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000448 if ( prefrh != -1) CloseResFile(prefrh);
Jack Jansenabdf93c1998-07-31 09:33:28 +0000449 UseResFile(oldrh);
Jack Jansena4b7e141996-02-21 16:46:57 +0000450}
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000451
Jack Jansen2d1306b2000-04-07 09:10:49 +0000452#ifdef USE_GUSI1
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000453void
454PyMac_SetGUSIOptions()
455{
456 Handle h;
457 short oldrh, prefrh = -1;
458
459 oldrh = CurResFile();
460
461 /* Try override from the application resource fork */
462 UseResFile(PyMac_AppRefNum);
463 h = Get1Resource('GU\267I', GUSIOPTIONSOVERRIDE_ID);
464 UseResFile(oldrh);
465
466 /* If that didn't work try nonoverride from anywhere */
467 if ( h == NULL ) {
468 prefrh = PyMac_OpenPrefFile();
469 h = GetResource('GU\267I', GUSIOPTIONS_ID);
470 }
471 if ( h ) GUSILoadConfiguration(h);
472 if ( prefrh != -1) CloseResFile(prefrh);
Jack Jansenabdf93c1998-07-31 09:33:28 +0000473 UseResFile(oldrh);
Jack Jansen3f7d2b41996-09-06 22:21:07 +0000474}
Jack Jansenee081042000-04-21 23:53:37 +0000475#endif /* USE_GUSI1 */