blob: 88ece9da6d19f773b45e47b484ecc2579a815a48 [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
Georg Brandl2067bfd2008-05-25 13:05:15 +000042extern void init_thread();
Andrew MacIntyre51801232003-01-02 12:40:41 +000043#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 MacIntyre378d3c02004-07-07 13:55:25 +000053extern void initcollections();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000054extern void initcmath();
Andrew MacIntyre51801232003-01-02 12:40:41 +000055extern void initdatetime();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000056extern void initdl();
57extern void initerrno();
58extern void initfcntl();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000059extern void init_functools();
Andrew MacIntyre378d3c02004-07-07 13:55:25 +000060extern void init_heapq();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000061extern void initimageop();
Andrew MacIntyred4c9b162003-04-21 14:28:01 +000062extern void inititertools();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000063extern void initmath();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000064extern void init_md5();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000065extern void initoperator();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000066extern void init_sha();
67extern void init_sha256();
68extern void init_sha512();
Thomas Wouters0e3f5912006-08-11 14:57:12 +000069extern void init_struct();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000070extern void inittermios();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000071extern void inittime();
Andrew MacIntyre4a79e362002-06-10 08:04:29 +000072extern void initxxsubtype();
Andrew MacIntyre51801232003-01-02 12:40:41 +000073extern void initzipimport();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000074#if !HAVE_DYNAMIC_LOADING
75extern void init_curses();
76extern void init_curses_panel();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000077extern void init_testcapi();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000078extern void initbz2();
79extern void initfpectl();
80extern void initfpetest();
81extern void initparser();
82extern void initpwd();
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000083extern void initunicodedata();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000084extern void initzlib();
Andrew MacIntyre51801232003-01-02 12:40:41 +000085#ifdef USE_SOCKET
86extern void init_socket();
87extern void initselect();
88#endif
89#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000090/* -- ADDMODULE MARKER 1 -- */
91
92extern void PyMarshal_Init();
93extern void initimp();
Andrew MacIntyre51801232003-01-02 12:40:41 +000094extern void initgc();
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000095
96struct _inittab _PyImport_Inittab[] = {
97
Andrew MacIntyre51801232003-01-02 12:40:41 +000098 {"os2", initos2},
99 {"signal", initsignal},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000100#ifdef WITH_THREAD
Georg Brandl2067bfd2008-05-25 13:05:15 +0000101 {"_thread", init_thread},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000102#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000103 {"_codecs", init_codecs},
Andrew MacIntyre58f22cc2003-06-09 08:16:02 +0000104 {"_csv", init_csv},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000105 {"_locale", init_locale},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000106 {"_random", init_random},
107 {"_sre", init_sre},
108 {"_symtable", init_symtable},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000109 {"_weakref", init_weakref},
110 {"array", initarray},
111 {"binascii", initbinascii},
Andrew MacIntyre378d3c02004-07-07 13:55:25 +0000112 {"collections", initcollections},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000113 {"cmath", initcmath},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000114 {"datetime", initdatetime},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000115 {"dl", initdl},
116 {"errno", initerrno},
117 {"fcntl", initfcntl},
Thomas Wouters0e3f5912006-08-11 14:57:12 +0000118 {"_functools", init_functools},
Andrew MacIntyre378d3c02004-07-07 13:55:25 +0000119 {"_heapq", init_heapq},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000120 {"imageop", initimageop},
Andrew MacIntyred4c9b162003-04-21 14:28:01 +0000121 {"itertools", inititertools},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000122 {"math", initmath},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000123 {"operator", initoperator},
Thomas Wouters0e3f5912006-08-11 14:57:12 +0000124 {"_sha256", init_sha256},
125 {"_sha512", init_sha512},
Thomas Wouters0e3f5912006-08-11 14:57:12 +0000126 {"_struct", init_struct},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000127 {"termios", inittermios},
128 {"time", inittime},
Andrew MacIntyre4a79e362002-06-10 08:04:29 +0000129 {"xxsubtype", initxxsubtype},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000130 {"zipimport", initzipimport},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000131#if !HAVE_DYNAMIC_LOADING
132 {"_curses", init_curses},
133 {"_curses_panel", init_curses_panel},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000134 {"_testcapi", init_testcapi},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000135 {"bz2", initbz2},
136 {"fpectl", initfpectl},
137 {"fpetest", initfpetest},
138 {"parser", initparser},
139 {"pwd", initpwd},
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000140 {"unicodedata", initunicodedata},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000141 {"zlib", initzlib},
142#ifdef USE_SOCKET
Andrew MacIntyre51801232003-01-02 12:40:41 +0000143 {"_socket", init_socket},
144 {"select", initselect},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000145#endif
146#endif
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000147/* -- ADDMODULE MARKER 2 -- */
148
Andrew MacIntyre51801232003-01-02 12:40:41 +0000149 /* This module "lives in" with marshal.c */
150 {"marshal", PyMarshal_Init},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000151
Andrew MacIntyre51801232003-01-02 12:40:41 +0000152 /* This lives it with import.c */
153 {"imp", initimp},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000154
Andrew MacIntyre51801232003-01-02 12:40:41 +0000155 /* These entries are here for sys.builtin_module_names */
156 {"__main__", NULL},
Georg Brandl1a3284e2007-12-02 09:40:06 +0000157 {"builtins", NULL},
Andrew MacIntyre51801232003-01-02 12:40:41 +0000158 {"sys", NULL},
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000159
Andrew MacIntyre51801232003-01-02 12:40:41 +0000160 /* This lives in gcmodule.c */
161 {"gc", initgc},
162
163 /* Sentinel */
164 {0, 0}
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000165};