@@ -22,222 +22,19 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2222
2323******************************************************************/
2424
25- /* Universal Python configuration file */
25+ /* Module configuration */
2626
27- #ifdef HAVE_CONFIG_H
28- #include "config.h"
29- #endif
27+ /* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
3028
31- #ifdef macintosh
32- /* The Macintosh main program is in macmain.c */
33- #define NO_MAIN
34- #endif
29+ /* This file contains the table of built-in modules.
30+ See init_builtin() in import.c. */
3531
36- #include <stdio.h>
37- #include <string.h>
32+ #include "Python.h"
3833
39- #include "myproto.h"
40- #include "mymalloc.h"
41- #include "osdefs.h"
42- #include "intrcheck.h"
43-
44- #if defined(__cplusplus )
45- extern "C" {
46- #endif
47-
48- #ifndef NO_MAIN
49-
50- /* Normally, the main program is called from here (so everything else
51- can be in libPython.a). We save a pointer to argv[0] because it
52- may be needed for dynamic loading of modules in import.c. If you
53- have your own main program and want to use non-SunOS dynamic
54- loading, you will have to provide your own version of
55- getprogramname(). */
56-
57- static char * argv0 ;
58-
59- /* These are made available for other modules that might need them.
60- This is rare, but it is needed by the secureware module. */
61-
62- static char * * orig_argv ;
63- static int orig_argc ;
64-
65- extern int realmain PROTO ((int , char * * ));
66-
67- #if defined(__cplusplus )
68- main (int argc , char * * argv )
69- #else
70- main (argc , argv )
71- int argc ;
72- char * * argv ;
73- #endif
74- {
75- orig_argc = argc ;
76- orig_argv = argv ;
77- argv0 = argv [0 ];
78- realmain (argc , argv );
79- }
80-
81- char *
82- getprogramname ()
83- {
84- return argv0 ;
85- }
86-
87- void
88- #if defined(__cplusplus )
89- getargcargv (int * argc , char * * * argv )
90- #else
91- getargcargv (argc ,argv )
92- int * argc ;
93- char * * * argv ;
94- #endif
95- {
96- * argc = orig_argc ;
97- * argv = orig_argv ;
98- }
99-
100- #endif
101-
102-
103- /* Python version information */
104-
105- #include "patchlevel.h"
106-
107- /* Return the version string. This is constructed from the official
108- version number (from patchlevel.h), and the current date (if known
109- to the compiler, else a manually inserted date). */
110-
111- #define VERSION "%s (%s)%s"
112-
113- #ifdef __DATE__
114- #define DATE __DATE__
115- #else
116- #define DATE "July 7 1995"
117- #endif
118-
119- #ifdef THINK_C
120- #define COMPILER " [THINK C]"
121- #endif
122-
123- #ifdef __MWERKS__
124- #ifdef __powerc
125- #define COMPILER " [CW PPC]"
126- #else
127- #define COMPILER " [CW 68K]"
128- #endif
129- #endif
130-
131- #ifdef MPW
132- #ifdef __SC__
133- #define COMPILER " [Symantec MPW]"
134- #else
135- #define COMPILER " [Apple MPW]"
136- #endif
137- #endif
138-
139- #ifdef __GNUC__
140- #define COMPILER " [GCC " __VERSION__ "]"
141- #endif
142-
143- #ifndef COMPILER
144- #define COMPILER ""
145- #endif
146-
147- char *
148- getversion ()
149- {
150- static char version [80 ];
151- sprintf (version , VERSION , PATCHLEVEL , DATE , COMPILER );
152- return version ;
153- }
154-
155-
156- /* Return the copyright string. This is updated manually. */
157-
158- char *
159- getcopyright ()
160- {
161- return "Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam" ;
162- }
163-
164-
165- /* Return the initial python search path. This is called once from
166- initsys() to initialize sys.path.
167- The environment variable PYTHONPATH is fetched and the default path
168- appended. (The Mac has no environment variables, so there the
169- default path is always returned.) The default path may be passed
170- to the preprocessor; if not, a system-dependent default is used. */
171-
172- #ifndef PYTHONPATH
173- #ifdef macintosh
174- #define PYTHONPATH ": :Lib :Lib:stdwin :Lib:test :Lib:mac"
175- #endif /* macintosh */
176- #endif /* !PYTHONPATH */
177-
178- #ifndef PYTHONPATH
179- #if defined(MSDOS ) || defined(NT )
180- #define PYTHONPATH ".;..\\lib;\\python\\lib"
181- #endif /* MSDOS || NT */
182- #endif /* !PYTHONPATH */
183-
184- #ifndef PYTHONPATH
185- #define PYTHONPATH ".:/usr/local/lib/python"
186- #endif /* !PYTHONPATH */
187-
188- #ifndef __cplusplus
189- extern char * getenv ();
190- #endif
191-
192- #ifndef PLATFORM
193- #define PLATFORM "unknown"
194- #endif
195-
196- char *
197- getplatform ()
198- {
199- return PLATFORM ;
200- }
201-
202- char *
203- getpythonpath ()
204- {
205- #ifdef __cplusplus
206- void fatal (char * );
207- #endif
208- char * path = getenv ("PYTHONPATH" );
209- char * defpath = PYTHONPATH ;
210- static char * buf = NULL ;
211- char * p ;
212- int n ;
213-
214- if (path == NULL )
215- path = "" ;
216- n = strlen (path ) + strlen (defpath ) + 2 ;
217- if (buf != NULL ) {
218- free (buf );
219- buf = NULL ;
220- }
221- buf = malloc (n );
222- if (buf == NULL )
223- fatal ("not enough memory to copy module search path" );
224- strcpy (buf , path );
225- p = buf + strlen (buf );
226- if (p != buf )
227- * p ++ = DELIM ;
228- strcpy (p , defpath );
229- return buf ;
230- }
231-
232-
233- /* Table of built-in modules.
234- These are initialized when first imported.
235- Note: selection of optional extensions is now generally done by the
236- makesetup script. */
23734
23835/* -- ADDMODULE MARKER 1 -- */
23936
240- extern void initmarshal ();
37+ extern void PyMarshal_Init ();
24138extern void initimp ();
24239
24340struct {
@@ -248,7 +45,7 @@ struct {
24845/* -- ADDMODULE MARKER 2 -- */
24946
25047 /* This module "lives in" with marshal.c */
251- {"marshal" , initmarshal },
48+ {"marshal" , PyMarshal_Init },
25249
25350 /* This lives it with import.c */
25451 {"imp" , initimp },
@@ -261,17 +58,3 @@ struct {
26158 /* Sentinel */
26259 {0 , 0 }
26360};
264-
265- #ifndef USE_FROZEN
266- struct frozen {
267- char * name ;
268- char * code ;
269- int size ;
270- } frozen_modules [] = {
271- {0 , 0 , 0 }
272- };
273- #endif
274-
275- #if defined(__cplusplus )
276- }
277- #endif
0 commit comments