From 52ac0372492200e326677c95ffc2fe35358c0dd2 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 15 Jan 1997 15:49:08 +0000 Subject: Added PyMac_Initialize() routine, to be used by embedding programs (in stead of standard Py_Initialize(), which it calls). --- Mac/Include/macglue.h | 1 + Mac/Python/macmain.c | 37 +- .../build.macppc.shared/PythonCorePPC.mu.exp | 1 + .../build.macppc.shared/PythonCorePPC.mu.hqx | 971 ++++++++++----------- .../projects/build.macppc.shared/PythonPPC.mu.hqx | 38 +- 5 files changed, 532 insertions(+), 516 deletions(-) diff --git a/Mac/Include/macglue.h b/Mac/Include/macglue.h index 907beb1..49575a7 100644 --- a/Mac/Include/macglue.h +++ b/Mac/Include/macglue.h @@ -102,3 +102,4 @@ PyObject *PyMac_BuildEventRecord(EventRecord *); /* Convert EventRecord to PyObj int PyMac_GetFixed(PyObject *, Fixed *); /* argument parser for Fixed */ PyObject *PyMac_BuildFixed(Fixed); /* Convert Fixed to PyObject */ void PyMac_InitApplet(void); /* Initialize and run an Applet */ +void PyMac_Initialize(void); /* Initialize function for embedding Python */ diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index 583ed1a..b60985d 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -192,7 +192,7 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp) ** Initialization code, shared by interpreter and applets */ static void -init_common(int *argcp, char ***argvp) +init_common(int *argcp, char ***argvp, int embedded) { /* Remember resource fork refnum, for later */ PyMac_AppRefNum = CurResFile(); @@ -223,11 +223,18 @@ init_common(int *argcp, char ***argvp) options.keep_error = 1; /* default-default */ PyMac_PreferenceOptions(&options); - /* Create argc/argv. Do it before we go into the options event loop. */ - *argcp = PyMac_GetArgv(argvp, options.noargs); - - /* Do interactive option setting, if allowed and