blob: bfe0ed9e7a17518a1685f9a852420e46aa039538 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001/***********************************************************
2Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
3Netherlands.
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI not be used in advertising or publicity pertaining to
13distribution of the software without specific, written prior permission.
14
15STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23******************************************************************/
24
Guido van Rossum28a83ab1991-01-18 15:32:01 +000025/* Configurable Python configuration file */
Guido van Rossumaec78551990-12-20 23:03:58 +000026
Guido van Rossum59e53a51991-02-19 12:22:24 +000027#include <stdio.h>
28
Guido van Rossum28a83ab1991-01-18 15:32:01 +000029#ifdef USE_STDWIN
30#include <stdwin.h>
Guido van Rossum28a83ab1991-01-18 15:32:01 +000031#endif
Guido van Rossumaec78551990-12-20 23:03:58 +000032
33/*ARGSUSED*/
34void
35initargs(p_argc, p_argv)
36 int *p_argc;
37 char ***p_argv;
38{
Guido van Rossum28a83ab1991-01-18 15:32:01 +000039#ifdef USE_STDWIN
Guido van Rossum5b02dbc1991-06-07 13:55:41 +000040 wargs(p_argc, p_argv);
Guido van Rossum28a83ab1991-01-18 15:32:01 +000041#endif
Guido van Rossumaec78551990-12-20 23:03:58 +000042}
43
44void
45initcalls()
46{
Guido van Rossumaec78551990-12-20 23:03:58 +000047}
48
49void
50donecalls()
51{
Guido van Rossum28a83ab1991-01-18 15:32:01 +000052#ifdef USE_STDWIN
Guido van Rossum5b02dbc1991-06-07 13:55:41 +000053 wdone();
Guido van Rossum28a83ab1991-01-18 15:32:01 +000054#endif
Guido van Rossumaec78551990-12-20 23:03:58 +000055#ifdef USE_AUDIO
56 asa_done();
57#endif
58}
59
60#ifndef PYTHONPATH
61#define PYTHONPATH ".:/usr/local/lib/python"
62#endif
63
64extern char *getenv();
65
66char *
67getpythonpath()
68{
69 char *path = getenv("PYTHONPATH");
70 if (path == 0)
71 path = PYTHONPATH;
72 return path;
73}
Guido van Rossum59e53a51991-02-19 12:22:24 +000074
75
76/* Table of built-in modules.
77 These are initialized when first imported. */
78
79/* Standard modules */
80extern void inittime();
81extern void initmath();
82extern void initregexp();
83extern void initposix();
Guido van Rossumac029481991-04-16 08:39:39 +000084extern void initpwd();
85extern void initgrp();
Guido van Rossum6f7b9591991-06-04 19:47:46 +000086extern void initmarshal();
87
Guido van Rossum59e53a51991-02-19 12:22:24 +000088#ifdef USE_AUDIO
89extern void initaudio();
90#endif
91#ifdef USE_AMOEBA
92extern void initamoeba();
93#endif
94#ifdef USE_GL
95extern void initgl();
Guido van Rossum2abc7a61991-04-03 19:01:18 +000096#ifdef USE_FM
97extern void initfm();
Guido van Rossum3fecef71991-08-16 08:58:56 +000098#ifdef USE_FL
99extern void initfl();
100#endif
Guido van Rossum2abc7a61991-04-03 19:01:18 +0000101#endif
Guido van Rossum59e53a51991-02-19 12:22:24 +0000102#ifdef USE_PANEL
103extern void initpanel();
104#endif
105#endif
106#ifdef USE_STDWIN
Guido van Rossum5b02dbc1991-06-07 13:55:41 +0000107extern void initstdwin();
Guido van Rossum59e53a51991-02-19 12:22:24 +0000108#endif
Guido van Rossum49955ae1991-07-01 18:45:17 +0000109#ifdef USE_SOCKET
110extern void initsocket();
111#endif
Guido van Rossum59e53a51991-02-19 12:22:24 +0000112
113struct {
114 char *name;
115 void (*initfunc)();
116} inittab[] = {
117
118 /* Standard modules */
119
120 {"time", inittime},
121 {"math", initmath},
122 {"regexp", initregexp},
123 {"posix", initposix},
Guido van Rossumac029481991-04-16 08:39:39 +0000124 {"pwd", initpwd},
125 {"grp", initgrp},
Guido van Rossum6f7b9591991-06-04 19:47:46 +0000126 {"marshal", initmarshal},
Guido van Rossum59e53a51991-02-19 12:22:24 +0000127
128
129 /* Optional modules */
130
131#ifdef USE_AUDIO
132 {"audio", initaudio},
133#endif
134
135#ifdef USE_AMOEBA
136 {"amoeba", initamoeba},
137#endif
138
139#ifdef USE_GL
140 {"gl", initgl},
Guido van Rossum2abc7a61991-04-03 19:01:18 +0000141#ifdef USE_FM
142 {"fm", initfm},
Guido van Rossum3fecef71991-08-16 08:58:56 +0000143#ifdef USE_FL
144 {"fl", initfl},
145#endif
Guido van Rossum2abc7a61991-04-03 19:01:18 +0000146#endif
Guido van Rossum59e53a51991-02-19 12:22:24 +0000147#ifdef USE_PANEL
148 {"pnl", initpanel},
149#endif
150#endif
151
152#ifdef USE_STDWIN
Guido van Rossum5b02dbc1991-06-07 13:55:41 +0000153 {"stdwin", initstdwin},
Guido van Rossum59e53a51991-02-19 12:22:24 +0000154#endif
155
Guido van Rossum49955ae1991-07-01 18:45:17 +0000156#ifdef USE_SOCKET
157 {"socket", initsocket},
158#endif
159
Guido van Rossum59e53a51991-02-19 12:22:24 +0000160 {0, 0} /* Sentinel */
161};