diff options
author | Guido van Rossum <guido@python.org> | 1990-12-20 23:03:58 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1990-12-20 23:03:58 (GMT) |
commit | aec78552273b8c4e44688b99e4436c23f1963e79 (patch) | |
tree | adf9eba94a3b6e0f375eef50f30bf451811e5689 /Modules/config.c.in | |
parent | 40d0b7e904396094fc3758ed48f22c12335c862a (diff) | |
download | cpython-aec78552273b8c4e44688b99e4436c23f1963e79.zip cpython-aec78552273b8c4e44688b99e4436c23f1963e79.tar.gz cpython-aec78552273b8c4e44688b99e4436c23f1963e79.tar.bz2 |
Initial revision
Diffstat (limited to 'Modules/config.c.in')
-rw-r--r-- | Modules/config.c.in | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/Modules/config.c.in b/Modules/config.c.in new file mode 100644 index 0000000..60f2cf2 --- /dev/null +++ b/Modules/config.c.in @@ -0,0 +1,86 @@ +/* Configuration containing EVERYTHING */ + +/* At CWI, this implies stdwin, audio, Amoeba and the NASA Panel Library */ +#define USE_AUDIO +#define USE_AMOEBA +#define USE_PANEL + +static int use_stdwin; + +/*ARGSUSED*/ +void +initargs(p_argc, p_argv) + int *p_argc; + char ***p_argv; +{ + extern char *getenv(); + char *display; + + /* Assume we have to initialize stdwin if either of the following + conditions holds: + - the environment variable $DISPLAY is set + - there is an argument "-display" somewhere + */ + + display = getenv("DISPLAY"); + if (display != 0) + use_stdwin = 1; + else { + int i; + /* Scan through the arguments looking for "-display" */ + for (i = 1; i < *p_argc; i++) { + if (strcmp((*p_argv)[i], "-display") == 0) { + use_stdwin = 1; + break; + } + } + } + + if (use_stdwin) + winitargs(p_argc, p_argv); +} + +void +initcalls() +{ + inittime(); + initmath(); + initposix(); +#ifdef USE_AUDIO + initaudio(); +#endif +#ifdef USE_AMOEBA + initamoeba(); +#endif + initgl(); +#ifdef USE_PANEL + initpanel(); +#endif + if (use_stdwin) + initstdwin(); +} + +void +donecalls() +{ + if (use_stdwin) + wdone(); +#ifdef USE_AUDIO + asa_done(); +#endif +} + +#ifndef PYTHONPATH +#define PYTHONPATH ".:/usr/local/lib/python" +#endif + +extern char *getenv(); + +char * +getpythonpath() +{ + char *path = getenv("PYTHONPATH"); + if (path == 0) + path = PYTHONPATH; + return path; +} |