blob: 9f3c093476a88b43c3fa2e706a5c5e4d8ef5e10b [file] [log] [blame]
Andrew MacIntyre41d97d62002-02-17 05:23:30 +00001/* -*- C -*- ***********************************************
2Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
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 or Corporation for National Research Initiatives or
13CNRI not be used in advertising or publicity pertaining to
14distribution of the software without specific, written prior
15permission.
16
17While CWI is the initial source for this software, a modified version
18is made available by the Corporation for National Research Initiatives
19(CNRI) at the Internet address ftp://ftp.python.org.
20
21STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28PERFORMANCE OF THIS SOFTWARE.
29
30******************************************************************/
31
32/* Module configuration */
33
34/* This file contains the table of built-in modules.
35 See init_builtin() in import.c. */
36
37#include "Python.h"
38
Andrew MacIntyre51801232003-01-02 12:40:41 +000039extern void initos2();
40extern void initsignal();
41#ifdef WITH_THREAD
42extern void initthread();
43#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000044extern void init_codecs();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000045extern void init_csv();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000046extern void init_locale();
Andrew MacIntyre51801232003-01-02 12:40:41 +000047extern void init_random();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000048extern void init_sre();
Andrew MacIntyre51801232003-01-02 12:40:41 +000049extern void init_symtable();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000050extern void init_weakref();
51extern void initarray();
52extern void initbinascii();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000053extern void initcPickle();
54extern void initcStringIO();
Andrew MacIntyre378d3c02004-07-07 13:55:25 +000055extern void initcollections();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000056extern void initcmath();
Andrew MacIntyre51801232003-01-02 12:40:41 +000057extern void initdatetime();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000058extern void initdl();
59extern void initerrno();
60extern void initfcntl();
Andrew MacIntyre378d3c02004-07-07 13:55:25 +000061extern void init_heapq();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000062extern void initimageop();
Andrew MacIntyred4c9b162003-04-21 14:28:01 +000063extern void inititertools();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000064extern void initmath();
65extern void initmd5();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000066extern void initoperator();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000067extern void initregex();
68extern void initrgbimg();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000069extern void initsha();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000070extern void initstrop();
71extern void initstruct();
72extern void inittermios();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000073extern void inittime();
74extern void inittiming();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000075extern void initxreadlines();
Andrew MacIntyre4a79e362002-06-10 08:04:29 +000076extern void initxxsubtype();
Andrew MacIntyre51801232003-01-02 12:40:41 +000077extern void initzipimport();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000078#if !HAVE_DYNAMIC_LOADING
79extern void init_curses();
80extern void init_curses_panel();
81extern void init_hotshot();
82extern void init_testcapi();
83extern void initbsddb185();
84extern void initbz2();
85extern void initfpectl();
86extern void initfpetest();
87extern void initparser();
88extern void initpwd();
89extern void initrotor();
90extern void initunicodedata();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000091extern void initzlib();
Andrew MacIntyre51801232003-01-02 12:40:41 +000092#ifdef USE_SOCKET
93extern void init_socket();
94extern void initselect();
95#endif
96#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000097/* -- ADDMODULE MARKER 1 -- */
98
99extern void PyMarshal_Init();
100extern void initimp();
Andrew MacIntyre51801232003-01-02 12:40:41 +0000101extern void initgc();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000102
103struct _inittab _PyImport_Inittab[] = {
104
Andrew MacIntyre51801232003-01-02 12:40:41 +0000105 {"os2", initos2},
106 {"signal", initsignal},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000107#ifdef WITH_THREAD
Andrew MacIntyre51801232003-01-02 12:40:41 +0000108 {"thread", initthread},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000109#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000110 {"_codecs", init_codecs},
Andrew MacIntyre58f22cc2003-06-09 08:16:02 +0000111 {"_csv", init_csv},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000112 {"_locale", init_locale},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000113 {"_random", init_random},
114 {"_sre", init_sre},
115 {"_symtable", init_symtable},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000116 {"_weakref", init_weakref},
117 {"array", initarray},
118 {"binascii", initbinascii},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000119 {"cPickle", initcPickle},
120 {"cStringIO", initcStringIO},
Andrew MacIntyre378d3c02004-07-07 13:55:25 +0000121 {"collections", initcollections},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000122 {"cmath", initcmath},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000123 {"datetime", initdatetime},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000124 {"dl", initdl},
125 {"errno", initerrno},
126 {"fcntl", initfcntl},
Andrew MacIntyre378d3c02004-07-07 13:55:25 +0000127 {"_heapq", init_heapq},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000128 {"imageop", initimageop},
Andrew MacIntyred4c9b162003-04-21 14:28:01 +0000129 {"itertools", inititertools},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000130 {"math", initmath},
131 {"md5", initmd5},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000132 {"operator", initoperator},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000133 {"regex", initregex},
134 {"rgbimg", initrgbimg},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000135 {"sha", initsha},
136 {"strop", initstrop},
137 {"struct", initstruct},
138 {"termios", inittermios},
139 {"time", inittime},
140 {"timing", inittiming},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000141 {"xreadlines", initxreadlines},
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000142 {"xxsubtype", initxxsubtype},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000143 {"zipimport", initzipimport},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000144#if !HAVE_DYNAMIC_LOADING
145 {"_curses", init_curses},
146 {"_curses_panel", init_curses_panel},
147 {"_hotshot", init_hotshot},
148 {"_testcapi", init_testcapi},
149 {"bsddb185", initbsddb185},
150 {"bz2", initbz2},
151 {"fpectl", initfpectl},
152 {"fpetest", initfpetest},
153 {"parser", initparser},
154 {"pwd", initpwd},
155 {"rotor", initrotor},
156 {"unicodedata", initunicodedata},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000157 {"zlib", initzlib},
158#ifdef USE_SOCKET
Andrew MacIntyre51801232003-01-02 12:40:41 +0000159 {"_socket", init_socket},
160 {"select", initselect},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000161#endif
162#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000163/* -- ADDMODULE MARKER 2 -- */
164
Andrew MacIntyre51801232003-01-02 12:40:41 +0000165 /* This module "lives in" with marshal.c */
166 {"marshal", PyMarshal_Init},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000167
Andrew MacIntyre51801232003-01-02 12:40:41 +0000168 /* This lives it with import.c */
169 {"imp", initimp},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000170
Andrew MacIntyre51801232003-01-02 12:40:41 +0000171 /* These entries are here for sys.builtin_module_names */
172 {"__main__", NULL},
173 {"__builtin__", NULL},
174 {"sys", NULL},
175 {"exceptions", NULL},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000176
Andrew MacIntyre51801232003-01-02 12:40:41 +0000177 /* This lives in gcmodule.c */
178 {"gc", initgc},
179
180 /* Sentinel */
181 {0, 0}
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000182};