Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 1 | /* -*- C -*- *********************************************** |
| 2 | Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 3 | The Netherlands. |
| 4 | |
| 5 | All Rights Reserved |
| 6 | |
| 7 | Permission to use, copy, modify, and distribute this software and its |
| 8 | documentation for any purpose and without fee is hereby granted, |
| 9 | provided that the above copyright notice appear in all copies and that |
| 10 | both that copyright notice and this permission notice appear in |
| 11 | supporting documentation, and that the names of Stichting Mathematisch |
| 12 | Centrum or CWI or Corporation for National Research Initiatives or |
| 13 | CNRI not be used in advertising or publicity pertaining to |
| 14 | distribution of the software without specific, written prior |
| 15 | permission. |
| 16 | |
| 17 | While CWI is the initial source for this software, a modified version |
| 18 | is made available by the Corporation for National Research Initiatives |
| 19 | (CNRI) at the Internet address ftp://ftp.python.org. |
| 20 | |
| 21 | STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
| 22 | REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
| 23 | MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
| 24 | CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
| 25 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 26 | PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 27 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 28 | PERFORMANCE 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 MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 39 | extern void initos2(); |
| 40 | extern void initsignal(); |
| 41 | #ifdef WITH_THREAD |
Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 42 | extern void init_thread(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 43 | #endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 44 | extern void init_codecs(); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 45 | extern void init_csv(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 46 | extern void init_locale(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 47 | extern void init_random(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 48 | extern void init_sre(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 49 | extern void init_symtable(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 50 | extern void init_weakref(); |
| 51 | extern void initarray(); |
| 52 | extern void initbinascii(); |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 53 | extern void initcollections(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 54 | extern void initcmath(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 55 | extern void initdatetime(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 56 | extern void initdl(); |
| 57 | extern void initerrno(); |
| 58 | extern void initfcntl(); |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 59 | extern void init_functools(); |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 60 | extern void init_heapq(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 61 | extern void initimageop(); |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 62 | extern void inititertools(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 63 | extern void initmath(); |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 64 | extern void init_md5(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 65 | extern void initoperator(); |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 66 | extern void init_sha(); |
| 67 | extern void init_sha256(); |
| 68 | extern void init_sha512(); |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 69 | extern void init_struct(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 70 | extern void inittermios(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 71 | extern void inittime(); |
Andrew MacIntyre | 4a79e36 | 2002-06-10 08:04:29 +0000 | [diff] [blame] | 72 | extern void initxxsubtype(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 73 | extern void initzipimport(); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 74 | #if !HAVE_DYNAMIC_LOADING |
| 75 | extern void init_curses(); |
| 76 | extern void init_curses_panel(); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 77 | extern void init_testcapi(); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 78 | extern void initbz2(); |
| 79 | extern void initfpectl(); |
| 80 | extern void initfpetest(); |
| 81 | extern void initparser(); |
| 82 | extern void initpwd(); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 83 | extern void initunicodedata(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 84 | extern void initzlib(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 85 | #ifdef USE_SOCKET |
| 86 | extern void init_socket(); |
| 87 | extern void initselect(); |
| 88 | #endif |
| 89 | #endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 90 | /* -- ADDMODULE MARKER 1 -- */ |
| 91 | |
| 92 | extern void PyMarshal_Init(); |
| 93 | extern void initimp(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 94 | extern void initgc(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 95 | |
| 96 | struct _inittab _PyImport_Inittab[] = { |
| 97 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 98 | {"os2", initos2}, |
| 99 | {"signal", initsignal}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 100 | #ifdef WITH_THREAD |
Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 101 | {"_thread", init_thread}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 102 | #endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 103 | {"_codecs", init_codecs}, |
Andrew MacIntyre | 58f22cc | 2003-06-09 08:16:02 +0000 | [diff] [blame] | 104 | {"_csv", init_csv}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 105 | {"_locale", init_locale}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 106 | {"_random", init_random}, |
| 107 | {"_sre", init_sre}, |
| 108 | {"_symtable", init_symtable}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 109 | {"_weakref", init_weakref}, |
| 110 | {"array", initarray}, |
| 111 | {"binascii", initbinascii}, |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 112 | {"collections", initcollections}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 113 | {"cmath", initcmath}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 114 | {"datetime", initdatetime}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 115 | {"dl", initdl}, |
| 116 | {"errno", initerrno}, |
| 117 | {"fcntl", initfcntl}, |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 118 | {"_functools", init_functools}, |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 119 | {"_heapq", init_heapq}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 120 | {"imageop", initimageop}, |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 121 | {"itertools", inititertools}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 122 | {"math", initmath}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 123 | {"operator", initoperator}, |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 124 | {"_sha256", init_sha256}, |
| 125 | {"_sha512", init_sha512}, |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 126 | {"_struct", init_struct}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 127 | {"termios", inittermios}, |
| 128 | {"time", inittime}, |
Andrew MacIntyre | 4a79e36 | 2002-06-10 08:04:29 +0000 | [diff] [blame] | 129 | {"xxsubtype", initxxsubtype}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 130 | {"zipimport", initzipimport}, |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 131 | #if !HAVE_DYNAMIC_LOADING |
| 132 | {"_curses", init_curses}, |
| 133 | {"_curses_panel", init_curses_panel}, |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 134 | {"_testcapi", init_testcapi}, |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 135 | {"bz2", initbz2}, |
| 136 | {"fpectl", initfpectl}, |
| 137 | {"fpetest", initfpetest}, |
| 138 | {"parser", initparser}, |
| 139 | {"pwd", initpwd}, |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 140 | {"unicodedata", initunicodedata}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 141 | {"zlib", initzlib}, |
| 142 | #ifdef USE_SOCKET |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 143 | {"_socket", init_socket}, |
| 144 | {"select", initselect}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 145 | #endif |
| 146 | #endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 147 | /* -- ADDMODULE MARKER 2 -- */ |
| 148 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 149 | /* This module "lives in" with marshal.c */ |
| 150 | {"marshal", PyMarshal_Init}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 151 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 152 | /* This lives it with import.c */ |
| 153 | {"imp", initimp}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 154 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 155 | /* These entries are here for sys.builtin_module_names */ |
| 156 | {"__main__", NULL}, |
Georg Brandl | 1a3284e | 2007-12-02 09:40:06 +0000 | [diff] [blame] | 157 | {"builtins", NULL}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 158 | {"sys", NULL}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 159 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 160 | /* This lives in gcmodule.c */ |
| 161 | {"gc", initgc}, |
| 162 | |
| 163 | /* Sentinel */ |
| 164 | {0, 0} |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 165 | }; |