From 7d5f9e847a75c65f97068b3fd7980e62717c16fc Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sat, 7 Sep 1996 17:09:31 +0000 Subject: - 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 --- Mac/Python/macmain.c | 298 ++++++++++++++++++++++++++++----------------------- 1 file changed, 162 insertions(+), 136 deletions(-) (limited to 'Mac/Python/macmain.c') diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index 095673e0f3..b4648726dd 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -60,16 +60,15 @@ extern char *Py_GetVersion Py_PROTO((void)); extern char *Py_GetCopyright Py_PROTO((void)); -/* For Py_GetProgramName(); set by main() */ -static char *argv0; +/* #define OBSOLETE_ARGCARGV 1 /* I think this is not needed anymore... */ +#ifdef OBSOLETE_ARGCARGV /* For Py_GetArgcArgv(); set by main() */ static char **orig_argv; static int orig_argc; +#endif -/* Flags indicating whether stdio window should stay open on termination */ -static int keep_normal; -static int keep_error = 1; +PyMac_PrefRecord options; static void Py_Main Py_PROTO((int, char **)); /* Forward */ void PyMac_Exit Py_PROTO((int)); /* Forward */ @@ -93,10 +92,108 @@ init_mac_world() #endif } -/* Initialization code shared by interpreter and applets */ +/* +** PyMac_InteractiveOptions - Allow user to set options if option key is pressed +*/ +static void +PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp) +{ + KeyMap rmap; + unsigned char *map; + short item, type; + ControlHandle handle; + DialogPtr dialog; + Rect rect; + int old_argc = *argcp; + int i; + + /* + ** If the preferences disallows interactive options we return, + ** similarly of