Mercurial > cpython-lru_cache-weakref
comparison Mac/Python/macmain.c @ 3930:52c19ee83a6b legacy-trunk
Guido's 1.4b2 fixes: Py_GetProgramName, Py_GetPrefix and Py_GetExecPrefix.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Fri, 02 Aug 1996 15:16:16 +0000 |
| parents | a22438e94fe9 |
| children | 5dc8c042905b |
comparison
equal
deleted
inserted
replaced
| 3929:ff68a2ec1ff1 | 3930:52c19ee83a6b |
|---|---|
| 56 /* Subroutines that live in their own file */ | 56 /* Subroutines that live in their own file */ |
| 57 extern char *Py_GetVersion Py_PROTO((void)); | 57 extern char *Py_GetVersion Py_PROTO((void)); |
| 58 extern char *Py_GetCopyright Py_PROTO((void)); | 58 extern char *Py_GetCopyright Py_PROTO((void)); |
| 59 | 59 |
| 60 | 60 |
| 61 /* For getprogramname(); set by main() */ | 61 /* For Py_GetProgramName(); set by main() */ |
| 62 static char *argv0; | 62 static char *argv0; |
| 63 | 63 |
| 64 /* For getargcargv(); set by main() */ | 64 /* For Py_GetArgcArgv(); set by main() */ |
| 65 static char **orig_argv; | 65 static char **orig_argv; |
| 66 static int orig_argc; | 66 static int orig_argc; |
| 67 | 67 |
| 68 /* Flags indicating whether stdio window should stay open on termination */ | 68 /* Flags indicating whether stdio window should stay open on termination */ |
| 69 static int keep_normal; | 69 static int keep_normal; |
| 314 int unbuffered = 0; | 314 int unbuffered = 0; |
| 315 | 315 |
| 316 PyMac_InteractiveOptions(&inspect, &Py_VerboseFlag, &Py_SuppressPrintingFlag, | 316 PyMac_InteractiveOptions(&inspect, &Py_VerboseFlag, &Py_SuppressPrintingFlag, |
| 317 &unbuffered, &Py_DebugFlag, &keep_normal, &keep_error, &argc, &argv); | 317 &unbuffered, &Py_DebugFlag, &keep_normal, &keep_error, &argc, &argv); |
| 318 | 318 |
| 319 orig_argc = argc; /* For getargcargv() */ | 319 orig_argc = argc; /* For Py_GetArgcArgv() */ |
| 320 orig_argv = argv; | 320 orig_argv = argv; |
| 321 argv0 = argv[0]; /* For getprogramname() */ | 321 argv0 = argv[0]; /* For Py_GetProgramName() */ |
| 322 | 322 |
| 323 if (unbuffered) { | 323 if (unbuffered) { |
| 324 #ifndef MPW | 324 #ifndef MPW |
| 325 setbuf(stdout, (char *)NULL); | 325 setbuf(stdout, (char *)NULL); |
| 326 setbuf(stderr, (char *)NULL); | 326 setbuf(stderr, (char *)NULL); |
| 401 } | 401 } |
| 402 | 402 |
| 403 /* Return the program name -- some code out there needs this. */ | 403 /* Return the program name -- some code out there needs this. */ |
| 404 | 404 |
| 405 char * | 405 char * |
| 406 getprogramname() | 406 Py_GetProgramName() |
| 407 { | 407 { |
| 408 return argv0; | 408 return argv0; |
| 409 } | 409 } |
| 410 | 410 |
| 411 | 411 |
| 412 /* Make the *original* argc/argv available to other modules. | 412 /* Make the *original* argc/argv available to other modules. |
| 413 This is rare, but it is needed by the secureware extension. */ | 413 This is rare, but it is needed by the secureware extension. */ |
| 414 | 414 |
| 415 void | 415 void |
| 416 getargcargv(argc,argv) | 416 Py_GetArgcArgv(argc,argv) |
| 417 int *argc; | 417 int *argc; |
| 418 char ***argv; | 418 char ***argv; |
| 419 { | 419 { |
| 420 *argc = orig_argc; | 420 *argc = orig_argc; |
| 421 *argv = orig_argv; | 421 *argv = orig_argv; |
| 422 } | 422 } |
| 423 | |
| 424 /* More cruft that shouldn't really be here, used in sysmodule.c */ | |
| 425 | |
| 426 char * | |
| 427 Py_GetPrefix() | |
| 428 { | |
| 429 return ""; | |
| 430 } | |
| 431 | |
| 432 char * | |
| 433 Py_GetExecPrefix() | |
| 434 { | |
| 435 return ""; | |
| 436 } |
