Kaydet (Commit) 7d5f9e84 authored tarafından Jack Jansen's avatar Jack Jansen

- Put all options in a struct

- Unified initialization code for interpreter and applet
- Implemented new options to skip AE-processing for argc/argv and for
  disabling interactive option setting
üst 6d653ab1
......@@ -95,13 +95,23 @@
#define POPT_NOINTOPT 7 /* Not settable interactively */
#define POPT_NOARGS 8 /* Not settable interactively */
typedef struct PyMac_PrefRecord {
unsigned char inspect;
unsigned char verbose;
unsigned char suppress_print;
unsigned char unbuffered;
unsigned char debugging;
unsigned char keep_normal;
unsigned char keep_error;
unsigned char nointopt;
unsigned char noargs;
} PyMac_PrefRecord;
/* The GUSI options resources */
#define GUSIOPTIONS_ID 10240
#define GUSIOPTIONSOVERRIDE_ID 10241
/* From macgetpath.c: */
void PyMac_PreferenceOptions Py_PROTO((int *inspect, int *verbose, int *suppress_print,
int *unbuffered, int *debugging, int *keep_normal,
int *keep_error));
void PyMac_PreferenceOptions Py_PROTO((PyMac_PrefRecord *));
......@@ -295,16 +295,19 @@ event_loop()
/* Get the argv vector, return argc */
int
PyMac_GetArgv(pargv)
PyMac_GetArgv(pargv, noevents)
char ***pargv;
int noevents;
{
arg_count = 0;
arg_vector[arg_count++] = strdup(get_application_name());
set_ae_handlers();
event_loop();
reset_ae_handlers();
if( !noevents ) {
set_ae_handlers();
event_loop();
reset_ae_handlers();
}
arg_vector[arg_count] = NULL;
......
......@@ -310,9 +310,7 @@ 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)
PyMac_PreferenceOptions(PyMac_PrefRecord *pr)
{
short oldrh, prefrh = -1;
Handle handle;
......@@ -339,14 +337,15 @@ PyMac_PreferenceOptions(int *inspect, int *verbose, int *suppress_print,
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];
/* The rest are not implemented yet */
if ( size > POPT_INSPECT ) pr->inspect = p[POPT_INSPECT];
if ( size > POPT_VERBOSE ) pr->verbose = p[POPT_VERBOSE];
if ( size > POPT_SUPPRESS ) pr->suppress_print = p[POPT_SUPPRESS];
if ( size > POPT_UNBUFFERED ) pr->unbuffered = p[POPT_UNBUFFERED];
if ( size > POPT_DEBUGGING ) pr->debugging = p[POPT_DEBUGGING];
if ( size > POPT_KEEPNORM ) pr->keep_normal = p[POPT_KEEPNORM];
if ( size > POPT_KEEPERR ) pr->keep_error = p[POPT_KEEPERR];
if ( size > POPT_NOINTOPT ) pr->nointopt = p[POPT_NOINTOPT];
if ( size > POPT_NOARGS ) pr->noargs = p[POPT_NOARGS];
HUnlock(handle);
......
......@@ -178,9 +178,11 @@ PyMac_FixGUSIcd()
return;
}
#ifdef __CFM68K__
/*
** SpinCursor (needed by GUSI) drags in heaps of stuff, so we
** provide a dummy here.
*/
void SpinCursor(short x) { /* Dummy */ }
#endif /* __CFM68K */
/*
** Replacement GUSI Spin function
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment