blob: cbab25c4fbfa18c3306b9e5e156650497c6dfa91 [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 MacIntyre41c56b52008-09-22 14:23:45 +000055extern void init_collections();
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 MacIntyre41c56b52008-09-22 14:23:45 +000061extern void init_fileio();
Andrew MacIntyrebb450372006-07-23 12:57:02 +000062extern void init_functools();
Andrew MacIntyre378d3c02004-07-07 13:55:25 +000063extern void init_heapq();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000064extern void initimageop();
Andrew MacIntyred4c9b162003-04-21 14:28:01 +000065extern void inititertools();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000066extern void initmath();
Andrew MacIntyrebb450372006-07-23 12:57:02 +000067extern void init_md5();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000068extern void initoperator();
Andrew MacIntyrebb450372006-07-23 12:57:02 +000069extern void init_sha();
70extern void init_sha256();
71extern void init_sha512();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000072extern void initstrop();
Andrew MacIntyrebb450372006-07-23 12:57:02 +000073extern void init_struct();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000074extern void inittermios();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000075extern void inittime();
76extern void inittiming();
Andrew MacIntyre4a79e362002-06-10 08:04:29 +000077extern void initxxsubtype();
Andrew MacIntyre51801232003-01-02 12:40:41 +000078extern void initzipimport();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000079#if !HAVE_DYNAMIC_LOADING
80extern void init_curses();
81extern void init_curses_panel();
82extern void init_hotshot();
83extern void init_testcapi();
84extern void initbsddb185();
85extern void initbz2();
86extern void initfpectl();
87extern void initfpetest();
88extern void initparser();
89extern void initpwd();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000090extern 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
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000105 {"os2", initos2},
106 {"signal", initsignal},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000107#ifdef WITH_THREAD
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000108 {"thread", initthread},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000109#endif
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000110 {"_codecs", init_codecs},
111 {"_csv", init_csv},
112 {"_locale", init_locale},
113 {"_random", init_random},
114 {"_sre", init_sre},
115 {"_symtable", init_symtable},
116 {"_weakref", init_weakref},
117 {"array", initarray},
118 {"binascii", initbinascii},
119 {"cPickle", initcPickle},
120 {"cStringIO", initcStringIO},
121 {"_collections", init_collections},
122 {"cmath", initcmath},
123 {"datetime", initdatetime},
124 {"dl", initdl},
125 {"errno", initerrno},
126 {"fcntl", initfcntl},
127 {"_fileio", init_fileio},
128 {"_functools", init_functools},
129 {"_heapq", init_heapq},
130 {"imageop", initimageop},
131 {"itertools", inititertools},
132 {"math", initmath},
133 {"_md5", init_md5},
134 {"operator", initoperator},
135 {"_sha", init_sha},
136 {"_sha256", init_sha256},
137 {"_sha512", init_sha512},
138 {"strop", initstrop},
139 {"_struct", init_struct},
140 {"termios", inittermios},
141 {"time", inittime},
142 {"timing", inittiming},
143 {"xxsubtype", initxxsubtype},
144 {"zipimport", initzipimport},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000145#if !HAVE_DYNAMIC_LOADING
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000146 {"_curses", init_curses},
147 {"_curses_panel", init_curses_panel},
148 {"_hotshot", init_hotshot},
149 {"_testcapi", init_testcapi},
150 {"bsddb185", initbsddb185},
151 {"bz2", initbz2},
152 {"fpectl", initfpectl},
153 {"fpetest", initfpetest},
154 {"parser", initparser},
155 {"pwd", initpwd},
156 {"unicodedata", initunicodedata},
157 {"zlib", initzlib},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000158#ifdef USE_SOCKET
Antoine Pitrouc7c96a92010-05-09 15:15:40 +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
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000165 /* This module "lives in" with marshal.c */
166 {"marshal", PyMarshal_Init},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000167
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000168 /* This lives it with import.c */
169 {"imp", initimp},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000170
Antoine Pitrouc7c96a92010-05-09 15:15:40 +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
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000177 /* This lives in gcmodule.c */
178 {"gc", initgc},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000179
Antoine Pitrouc7c96a92010-05-09 15:15:40 +0000180 /* Sentinel */
181 {0, 0}
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000182};