diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-02-21 16:46:57 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-02-21 16:46:57 (GMT) |
commit | a4b7e14df87e0a39e06d5655ac29cb71cc052721 (patch) | |
tree | 572705439d12bf0842e004dc91bb08ca32523b00 /Mac/Python/macgetpath.c | |
parent | 532e3c2bf61d964a34af054f7c270d0322682eac (diff) | |
download | cpython-a4b7e14df87e0a39e06d5655ac29cb71cc052721.zip cpython-a4b7e14df87e0a39e06d5655ac29cb71cc052721.tar.gz cpython-a4b7e14df87e0a39e06d5655ac29cb71cc052721.tar.bz2 |
Store default startup options in preference file or
app.
Diffstat (limited to 'Mac/Python/macgetpath.c')
-rw-r--r-- | Mac/Python/macgetpath.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Mac/Python/macgetpath.c b/Mac/Python/macgetpath.c index 5e528f7..b782736 100644 --- a/Mac/Python/macgetpath.c +++ b/Mac/Python/macgetpath.c @@ -263,3 +263,37 @@ out: } #endif /* !USE_BUILTIN_PATH */ +void +PyMac_PreferenceOptions(int *inspect, int *verbose, int *suppress_print, + int *unbuffered, int *debugging, int *keep_normal, + int *keep_error) +{ + short oldrh, prefrh; + Handle handle; + int size; + char *p; + + + oldrh = CurResFile(); + prefrh = PyMac_OpenPrefFile(); + handle = GetResource('Popt', PYTHONOPTIONS_ID); + if ( handle == NULL ) { + return; + } + HLock(handle); + size = GetHandleSize(handle); + p = (char *)*handle; + + if ( size > POPT_INSPECT ) *inspect = p[POPT_INSPECT]; + if ( size > POPT_VERBOSE ) *verbose = p[POPT_VERBOSE]; + if ( size > POPT_SUPPRESS ) *suppress_print = p[POPT_SUPPRESS]; + if ( size > POPT_UNBUFFERED ) *unbuffered = p[POPT_UNBUFFERED]; + if ( size > POPT_DEBUGGING ) *debugging = p[POPT_DEBUGGING]; + if ( size > POPT_KEEPNORM ) *keep_normal = p[POPT_KEEPNORM]; + if ( size > POPT_KEEPERR ) *keep_error = p[POPT_KEEPERR]; + + HUnlock(handle); + + CloseResFile(prefrh); + UseResFile(oldrh); +} |