@@ -62,9 +62,6 @@ extern PyMac_AddLibResources(void);
6262#define COPYRIGHT \
6363 "Type \"copyright\", \"credits\" or \"license\" for more information."
6464
65-
66- extern int Py_DebugFlag ; /* For parser.c, declared in pythonrun.c */
67- extern int Py_VerboseFlag ; /* For import.c, declared in pythonrun.c */
6865short PyMac_AppRefNum ; /* RefNum of application resource fork */
6966
7067/* For Py_GetArgcArgv(); set by main() */
@@ -159,6 +156,7 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
159156
160157 SET_OPT_ITEM (OPT_INSPECT , inspect );
161158 SET_OPT_ITEM (OPT_VERBOSE , verbose );
159+ /* OPT_VERBOSEVERBOSE is default off */
162160 SET_OPT_ITEM (OPT_OPTIMIZE , optimize );
163161 SET_OPT_ITEM (OPT_UNBUFFERED , unbuffered );
164162 SET_OPT_ITEM (OPT_DEBUGGING , debugging );
@@ -173,7 +171,8 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
173171/* SET_OPT_ITEM(OPT_KEEPCONSOLE, keep_console); */
174172 SET_OPT_ITEM (OPT_TABWARN , tabwarn );
175173 SET_OPT_ITEM (OPT_NOSITE , nosite );
176- SET_OPT_ITEM (OPT_NONAVSERV , nonavservice );
174+ SET_OPT_ITEM (OPT_DIVISIONWARN , divisionwarn );
175+ SET_OPT_ITEM (OPT_UNIXNEWLINES , unixnewlines );
177176 /* The rest are not settable interactively */
178177
179178#undef SET_OPT_ITEM
@@ -219,6 +218,16 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
219218
220219 OPT_ITEM (OPT_INSPECT , inspect );
221220 OPT_ITEM (OPT_VERBOSE , verbose );
221+ if ( item == OPT_VERBOSEVERBOSE ) {
222+ if ( p -> verbose == 2 )
223+ p -> verbose = 1 ;
224+ else
225+ p -> verbose = 2 ;
226+ GetDialogItem (dialog , OPT_VERBOSE , & type , (Handle * )& handle , & rect );
227+ SetControlValue (handle , 1 );
228+ }
229+ GetDialogItem (dialog , OPT_VERBOSEVERBOSE , & type , (Handle * )& handle , & rect );
230+ SetControlValue (handle , p -> verbose == 2 );
222231 OPT_ITEM (OPT_OPTIMIZE , optimize );
223232 OPT_ITEM (OPT_UNBUFFERED , unbuffered );
224233 OPT_ITEM (OPT_DEBUGGING , debugging );
@@ -236,7 +245,8 @@ PyMac_InteractiveOptions(PyMac_PrefRecord *p, int *argcp, char ***argvp)
236245 SetControlValue (handle , (short )(p -> keep_console == POPT_KEEPCONSOLE_NEVER ));
237246 OPT_ITEM (OPT_TABWARN , tabwarn );
238247 OPT_ITEM (OPT_NOSITE , nosite );
239- OPT_ITEM (OPT_NONAVSERV , nonavservice );
248+ OPT_ITEM (OPT_DIVISIONWARN , divisionwarn );
249+ OPT_ITEM (OPT_UNIXNEWLINES , unixnewlines );
240250
241251#undef OPT_ITEM
242252 }
@@ -315,6 +325,7 @@ init_common(int *argcp, char ***argvp, int embedded)
315325 Py_DebugFlag = PyMac_options .debugging ;
316326 Py_NoSiteFlag = PyMac_options .nosite ;
317327 Py_TabcheckFlag = PyMac_options .tabwarn ;
328+ Py_DivisionWarningFlag = PyMac_options .divisionwarn ;
318329 if ( PyMac_options .noargs ) {
319330 /* don't process events at all without the scripts permission */
320331 PyMacSchedParams scp ;
674685PyMac_GetDelayConsoleFlag ()
675686{
676687 return (int )PyMac_options .delayconsole ;
677- }
688+ }
689+
690+ #ifndef WITHOUT_UNIX_NEWLINES
691+ /*
692+ ** Experimental feature (for 2.2a2): optionally allow unix newlines
693+ ** as well as Mac newlines on input. We replace a lowlevel
694+ ** MSL routine to accomplish this.
695+ */
696+ void
697+ __convert_to_newlines (unsigned char * buf , size_t * n_ptr )
698+ {
699+ unsigned char * p ;
700+ size_t n = * n_ptr ;
701+
702+ for (p = buf ; n > 0 ; p ++ , n -- )
703+ if ( * p == '\r' ) * p = '\n' ;
704+ else if ( * p == '\n' && !PyMac_options .unixnewlines )
705+ * p = '\r' ;
706+ }
707+ #endif /* WITHOUT_UNIX_NEWLINES */
708+
0 commit comments