char *curwd;
char *p, *endp;
int newlen;
- extern char *PyMac_GetPythonDir();
+ staticforward char *PyMac_GetPythonDir();
#ifndef USE_BUILTIN_PATH
- extern char *PyMac_GetPythonPath();
+ staticforward char *PyMac_GetPythonPath();
#endif
if ( pythonpath ) return pythonpath;
/*
** Open/create the Python Preferences file, return the handle
*/
-short
+static short
PyMac_OpenPrefFile()
{
AliasHandle handle;
/*
** Return the name of the Python directory
*/
-char *
+static char *
PyMac_GetPythonDir()
{
static char name[256];
}
#ifndef USE_BUILTIN_PATH
-char *
+static char *
PyMac_GetPythonPath(dir)
char *dir;
{
static int keep_normal;
static int keep_error = 1;
+/* Initialize the Mac toolbox world */
+
+static void
+init_mac_world()
+{
+#ifdef THINK_C
+ printf("\n");
+#else
+ MaxApplZone();
+ InitGraf(&qd.thePort);
+ InitFonts();
+ InitWindows();
+ TEInit();
+ InitDialogs((long)0);
+ InitMenus();
+ InitCursor();
+#endif
+}
+
+/* Initialization code shared by interpreter and applets */
+
+static void
+init_common()
+{
+
+ /* Initialize toolboxes */
+ init_mac_world();
+
+#ifdef USE_MAC_SHARED_LIBRARY
+ /* Add the shared library to the stack of resource files */
+ PyMac_AddLibResources();
+#endif
+
+#if defined(USE_GUSI)
+ /* Setup GUSI */
+ GUSIDefaultSetup();
+#endif
+
+#ifdef USE_SIOUX
+ /* Set various SIOUX flags. Some are changed later based on options */
+ SIOUXSettings.asktosaveonclose = 0;
+ SIOUXSettings.showstatusline = 0;
+ SIOUXSettings.tabspaces = 4;
+#endif
+
+}
+
+
#ifdef USE_MAC_APPLET_SUPPORT
/* Applet support */
char **argv;
int err;
-#ifdef USE_MAC_SHARED_LIBRARY
- PyMac_AddLibResources();
-#endif
-#ifdef USE_SIOUX
- SIOUXSettings.asktosaveonclose = 0;
- SIOUXSettings.showstatusline = 0;
- SIOUXSettings.tabspaces = 4;
-#endif
+ init_common();
argc = PyMac_GetArgv(&argv);
Py_Initialize();
PySys_SetArgv(argc, argv);
int argc;
char **argv;
-#ifdef USE_MAC_SHARED_LIBRARY
- PyMac_AddLibResources();
-#endif
-#ifdef USE_SIOUX
- SIOUXSettings.asktosaveonclose = 0;
- SIOUXSettings.showstatusline = 0;
- SIOUXSettings.tabspaces = 4;
-#endif
+ init_common();
argc = PyMac_GetArgv(&argv);
if ( argc > 1 ) {
/* We're running a script. Attempt to change current directory */
/* Default-defaults: */
*keep_error = 1;
/* Get default settings from our preference file */
- PyMac_PreferenceOptions(&inspect, &Py_VerboseFlag, &Py_SuppressPrintingFlag,
- &unbuffered, &Py_DebugFlag, &keep_normal, &keep_error);
+ PyMac_PreferenceOptions(inspect, verbose, suppress_print,
+ unbuffered, debugging, keep_normal, keep_error);
/* If option is pressed override these */
GetKeys(rmap);
map = (unsigned char *)rmap;