summaryrefslogtreecommitdiffstats
path: root/Python/frozenmain.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-30 08:27:36 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-30 08:27:36 (GMT)
commit1d5735e84621a7fe68d361fa0e289fa2c3310836 (patch)
tree4ee6f32fa4743f4c6641b04131e449bc71a5ea25 /Python/frozenmain.c
parent013142a95fd63a05d09cec7b36b7c86cc98e30c1 (diff)
downloadcpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.zip
cpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.tar.gz
cpython-1d5735e84621a7fe68d361fa0e289fa2c3310836.tar.bz2
Merge back to main trunk
Diffstat (limited to 'Python/frozenmain.c')
-rw-r--r--Python/frozenmain.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index 8f35ea5..20d0364 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -1,5 +1,5 @@
/***********************************************************
-Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
@@ -28,9 +28,14 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
extern char *getenv();
+extern char *getversion();
+extern char *getcopyright();
+
extern int debugging;
extern int verbose;
-extern int killprint;
+extern int suppress_print;
+
+static char *argv0;
main(argc, argv)
int argc;
@@ -39,17 +44,29 @@ main(argc, argv)
char *p;
int n, sts;
int inspect = 0;
+ int unbuffered = 0;
+
+ argv0 = argv[0];
if ((p = getenv("PYTHONDEBUG")) && *p != '\0')
debugging = 1;
+ if ((p = getenv("PYTHONSUPPRESS")) && *p != '\0')
+ suppress_print = 1;
if ((p = getenv("PYTHONVERBOSE")) && *p != '\0')
verbose = 1;
if ((p = getenv("PYTHONINSPECT")) && *p != '\0')
inspect = 1;
- if ((p = getenv("PYTHONKILLPRINT")) && *p != '\0')
- killprint = 1;
+ if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
+ unbuffered = 1;
+
+ if (unbuffered) {
+ setbuf(stdout, (char *)NULL);
+ setbuf(stderr, (char *)NULL);
+ }
- initargs(&argc, &argv);
+ if (verbose)
+ fprintf(stderr, "Python %s\n%s\n",
+ getversion(), getcopyright());
initall();
setpythonargv(argc, argv);
@@ -69,3 +86,9 @@ main(argc, argv)
goaway(sts);
/*NOTREACHED*/
}
+
+char *
+getprogramname()
+{
+ return argv0;
+}