blob: 47378fd5c381a832d09b69ed20d1de3d735079d0 [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 initcStringIO();
Andrew MacIntyre378d3c02004-07-07 13:55:25 +000054extern void initcollections();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000055extern void initcmath();
Andrew MacIntyre51801232003-01-02 12:40:41 +000056extern void initdatetime();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000057extern void initdl();
58extern void initerrno();
59extern void initfcntl();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000060extern void init_functools();
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();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000065extern void init_md5();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000066extern void initoperator();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000067extern void init_sha();
68extern void init_sha256();
69extern void init_sha512();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000070extern void init_struct();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000071extern void inittermios();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000072extern void inittime();
Andrew MacIntyre4a79e362002-06-10 08:04:29 +000073extern void initxxsubtype();
Andrew MacIntyre51801232003-01-02 12:40:41 +000074extern void initzipimport();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000075#if !HAVE_DYNAMIC_LOADING
76extern void init_curses();
77extern void init_curses_panel();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000078extern void init_testcapi();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000079extern void initbz2();
80extern void initfpectl();
81extern void initfpetest();
82extern void initparser();
83extern void initpwd();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000084extern void initunicodedata();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000085extern void initzlib();
Andrew MacIntyre51801232003-01-02 12:40:41 +000086#ifdef USE_SOCKET
87extern void init_socket();
88extern void initselect();
89#endif
90#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000091/* -- ADDMODULE MARKER 1 -- */
92
93extern void PyMarshal_Init();
94extern void initimp();
Andrew MacIntyre51801232003-01-02 12:40:41 +000095extern void initgc();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000096
97struct _inittab _PyImport_Inittab[] = {
98
Andrew MacIntyre51801232003-01-02 12:40:41 +000099 {"os2", initos2},
100 {"signal", initsignal},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000101#ifdef WITH_THREAD
Andrew MacIntyre51801232003-01-02 12:40:41 +0000102 {"thread", initthread},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000103#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000104 {"_codecs", init_codecs},
Andrew MacIntyre58f22cc2003-06-09 08:16:02 +0000105 {"_csv", init_csv},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000106 {"_locale", init_locale},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000107 {"_random", init_random},
108 {"_sre", init_sre},
109 {"_symtable", init_symtable},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000110 {"_weakref", init_weakref},
111 {"array", initarray},
112 {"binascii", initbinascii},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000113 {"cStringIO", initcStringIO},
Andrew MacIntyre378d3c02004-07-07 13:55:25 +0000114 {"collections", initcollections},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000115 {"cmath", initcmath},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000116 {"datetime", initdatetime},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000117 {"dl", initdl},
118 {"errno", initerrno},
119 {"fcntl", initfcntl},
Thomas Wouters0e3f5912006-08-11 14:57:12 +0000120 {"_functools", init_functools},
Andrew MacIntyre378d3c02004-07-07 13:55:25 +0000121 {"_heapq", init_heapq},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000122 {"imageop", initimageop},
Andrew MacIntyred4c9b162003-04-21 14:28:01 +0000123 {"itertools", inititertools},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000124 {"math", initmath},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000125 {"operator", initoperator},
Thomas Wouters0e3f5912006-08-11 14:57:12 +0000126 {"_sha256", init_sha256},
127 {"_sha512", init_sha512},
Thomas Wouters0e3f5912006-08-11 14:57:12 +0000128 {"_struct", init_struct},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000129 {"termios", inittermios},
130 {"time", inittime},
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000131 {"xxsubtype", initxxsubtype},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000132 {"zipimport", initzipimport},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000133#if !HAVE_DYNAMIC_LOADING
134 {"_curses", init_curses},
135 {"_curses_panel", init_curses_panel},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000136 {"_testcapi", init_testcapi},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000137 {"bz2", initbz2},
138 {"fpectl", initfpectl},
139 {"fpetest", initfpetest},
140 {"parser", initparser},
141 {"pwd", initpwd},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000142 {"unicodedata", initunicodedata},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000143 {"zlib", initzlib},
144#ifdef USE_SOCKET
Andrew MacIntyre51801232003-01-02 12:40:41 +0000145 {"_socket", init_socket},
146 {"select", initselect},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000147#endif
148#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000149/* -- ADDMODULE MARKER 2 -- */
150
Andrew MacIntyre51801232003-01-02 12:40:41 +0000151 /* This module "lives in" with marshal.c */
152 {"marshal", PyMarshal_Init},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000153
Andrew MacIntyre51801232003-01-02 12:40:41 +0000154 /* This lives it with import.c */
155 {"imp", initimp},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000156
Andrew MacIntyre51801232003-01-02 12:40:41 +0000157 /* These entries are here for sys.builtin_module_names */
158 {"__main__", NULL},
Georg Brandl1a3284e2007-12-02 09:40:06 +0000159 {"builtins", NULL},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000160 {"sys", NULL},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000161
Andrew MacIntyre51801232003-01-02 12:40:41 +0000162 /* This lives in gcmodule.c */
163 {"gc", initgc},
164
165 /* Sentinel */
166 {0, 0}
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000167};