Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
59e53a56
Commit
59e53a56
authored
Feb 19, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turned the list of init calls into a table (see import.c).
parent
865828d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
25 deletions
+77
-25
Modules/config.c.in
Modules/config.c.in
+77
-25
No files found.
Modules/config.c.in
View file @
59e53a56
/* Configurable Python configuration file */
#include <stdio.h>
#ifdef USE_STDWIN
#include <stdwin.h>
...
...
@@ -43,37 +45,13 @@ initargs(p_argc, p_argv)
}
if (use_stdwin)
w
init
args(p_argc, p_argv);
wargs(p_argc, p_argv);
#endif
}
void
initcalls()
{
inittime();
initmath();
initregexp();
initposix();
#ifdef USE_AUDIO
initaudio();
#endif
#ifdef USE_AMOEBA
initamoeba();
#endif
#ifdef USE_GL
initgl();
#ifdef USE_PANEL
initpanel();
#endif
#endif
#ifdef USE_STDWIN
if (use_stdwin)
initstdwin();
#endif
}
void
...
...
@@ -88,6 +66,18 @@ donecalls()
#endif
}
#ifdef USE_STDWIN
static void
maybeinitstdwin()
{
if (use_stdwin)
initstdwin();
else
fprintf(stderr,
"No $DISPLAY nor -display arg -- stdwin not available\n");
}
#endif
#ifndef PYTHONPATH
#define PYTHONPATH ".:/usr/local/lib/python"
#endif
...
...
@@ -102,3 +92,65 @@ getpythonpath()
path = PYTHONPATH;
return path;
}
/* Table of built-in modules.
These are initialized when first imported. */
/* Standard modules */
extern void inittime();
extern void initmath();
extern void initregexp();
extern void initposix();
#ifdef USE_AUDIO
extern void initaudio();
#endif
#ifdef USE_AMOEBA
extern void initamoeba();
#endif
#ifdef USE_GL
extern void initgl();
#ifdef USE_PANEL
extern void initpanel();
#endif
#endif
#ifdef USE_STDWIN
extern void maybeinitstdwin();
#endif
struct {
char *name;
void (*initfunc)();
} inittab[] = {
/* Standard modules */
{"time", inittime},
{"math", initmath},
{"regexp", initregexp},
{"posix", initposix},
/* Optional modules */
#ifdef USE_AUDIO
{"audio", initaudio},
#endif
#ifdef USE_AMOEBA
{"amoeba", initamoeba},
#endif
#ifdef USE_GL
{"gl", initgl},
#ifdef USE_PANEL
{"pnl", initpanel},
#endif
#endif
#ifdef USE_STDWIN
{"stdwin", maybeinitstdwin},
#endif
{0, 0} /* Sentinel */
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment