Mercurial > cpython-lru_cache-weakref
comparison Mac/Python/macgetpath.c @ 3411:14991c4331df legacy-trunk
Store default startup options in preference file or
app.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Wed, 21 Feb 1996 16:46:57 +0000 |
| parents | 022474ac2451 |
| children | 67f5d29d405b |
comparison
equal
deleted
inserted
replaced
| 3410:022474ac2451 | 3411:14991c4331df |
|---|---|
| 261 } | 261 } |
| 262 return rv; | 262 return rv; |
| 263 } | 263 } |
| 264 #endif /* !USE_BUILTIN_PATH */ | 264 #endif /* !USE_BUILTIN_PATH */ |
| 265 | 265 |
| 266 void | |
| 267 PyMac_PreferenceOptions(int *inspect, int *verbose, int *suppress_print, | |
| 268 int *unbuffered, int *debugging, int *keep_normal, | |
| 269 int *keep_error) | |
| 270 { | |
| 271 short oldrh, prefrh; | |
| 272 Handle handle; | |
| 273 int size; | |
| 274 char *p; | |
| 275 | |
| 276 | |
| 277 oldrh = CurResFile(); | |
| 278 prefrh = PyMac_OpenPrefFile(); | |
| 279 handle = GetResource('Popt', PYTHONOPTIONS_ID); | |
| 280 if ( handle == NULL ) { | |
| 281 return; | |
| 282 } | |
| 283 HLock(handle); | |
| 284 size = GetHandleSize(handle); | |
| 285 p = (char *)*handle; | |
| 286 | |
| 287 if ( size > POPT_INSPECT ) *inspect = p[POPT_INSPECT]; | |
| 288 if ( size > POPT_VERBOSE ) *verbose = p[POPT_VERBOSE]; | |
| 289 if ( size > POPT_SUPPRESS ) *suppress_print = p[POPT_SUPPRESS]; | |
| 290 if ( size > POPT_UNBUFFERED ) *unbuffered = p[POPT_UNBUFFERED]; | |
| 291 if ( size > POPT_DEBUGGING ) *debugging = p[POPT_DEBUGGING]; | |
| 292 if ( size > POPT_KEEPNORM ) *keep_normal = p[POPT_KEEPNORM]; | |
| 293 if ( size > POPT_KEEPERR ) *keep_error = p[POPT_KEEPERR]; | |
| 294 | |
| 295 HUnlock(handle); | |
| 296 | |
| 297 CloseResFile(prefrh); | |
| 298 UseResFile(oldrh); | |
| 299 } |
