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 |
| 42 | extern void initthread(); |
| 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 | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 53 | extern void initcPickle(); |
| 54 | extern void initcStringIO(); |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 55 | extern void initcollections(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 56 | extern void initcmath(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 57 | extern void initdatetime(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 58 | extern void initdl(); |
| 59 | extern void initerrno(); |
| 60 | extern void initfcntl(); |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 61 | extern void init_heapq(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 62 | extern void initimageop(); |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 63 | extern void inititertools(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 64 | extern void initmath(); |
| 65 | extern void initmd5(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 66 | extern void initoperator(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 67 | extern void initrgbimg(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 68 | extern void initsha(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 69 | extern void initstrop(); |
| 70 | extern void initstruct(); |
| 71 | extern void inittermios(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 72 | extern void inittime(); |
| 73 | extern void inittiming(); |
Andrew MacIntyre | 4a79e36 | 2002-06-10 08:04:29 +0000 | [diff] [blame] | 74 | extern void initxxsubtype(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 75 | extern void initzipimport(); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 76 | #if !HAVE_DYNAMIC_LOADING |
| 77 | extern void init_curses(); |
| 78 | extern void init_curses_panel(); |
| 79 | extern void init_hotshot(); |
| 80 | extern void init_testcapi(); |
| 81 | extern void initbsddb185(); |
| 82 | extern void initbz2(); |
| 83 | extern void initfpectl(); |
| 84 | extern void initfpetest(); |
| 85 | extern void initparser(); |
| 86 | extern void initpwd(); |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 87 | extern void initunicodedata(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 88 | extern void initzlib(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 89 | #ifdef USE_SOCKET |
| 90 | extern void init_socket(); |
| 91 | extern void initselect(); |
| 92 | #endif |
| 93 | #endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 94 | /* -- ADDMODULE MARKER 1 -- */ |
| 95 | |
| 96 | extern void PyMarshal_Init(); |
| 97 | extern void initimp(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 98 | extern void initgc(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 99 | |
| 100 | struct _inittab _PyImport_Inittab[] = { |
| 101 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 102 | {"os2", initos2}, |
| 103 | {"signal", initsignal}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 104 | #ifdef WITH_THREAD |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 105 | {"thread", initthread}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 106 | #endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 107 | {"_codecs", init_codecs}, |
Andrew MacIntyre | 58f22cc | 2003-06-09 08:16:02 +0000 | [diff] [blame] | 108 | {"_csv", init_csv}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 109 | {"_locale", init_locale}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 110 | {"_random", init_random}, |
| 111 | {"_sre", init_sre}, |
| 112 | {"_symtable", init_symtable}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 113 | {"_weakref", init_weakref}, |
| 114 | {"array", initarray}, |
| 115 | {"binascii", initbinascii}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 116 | {"cPickle", initcPickle}, |
| 117 | {"cStringIO", initcStringIO}, |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 118 | {"collections", initcollections}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 119 | {"cmath", initcmath}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 120 | {"datetime", initdatetime}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 121 | {"dl", initdl}, |
| 122 | {"errno", initerrno}, |
| 123 | {"fcntl", initfcntl}, |
Andrew MacIntyre | 378d3c0 | 2004-07-07 13:55:25 +0000 | [diff] [blame] | 124 | {"_heapq", init_heapq}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 125 | {"imageop", initimageop}, |
Andrew MacIntyre | d4c9b16 | 2003-04-21 14:28:01 +0000 | [diff] [blame] | 126 | {"itertools", inititertools}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 127 | {"math", initmath}, |
| 128 | {"md5", initmd5}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 129 | {"operator", initoperator}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 130 | {"rgbimg", initrgbimg}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 131 | {"sha", initsha}, |
| 132 | {"strop", initstrop}, |
| 133 | {"struct", initstruct}, |
| 134 | {"termios", inittermios}, |
| 135 | {"time", inittime}, |
| 136 | {"timing", inittiming}, |
Andrew MacIntyre | 4a79e36 | 2002-06-10 08:04:29 +0000 | [diff] [blame] | 137 | {"xxsubtype", initxxsubtype}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 138 | {"zipimport", initzipimport}, |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 139 | #if !HAVE_DYNAMIC_LOADING |
| 140 | {"_curses", init_curses}, |
| 141 | {"_curses_panel", init_curses_panel}, |
| 142 | {"_hotshot", init_hotshot}, |
| 143 | {"_testcapi", init_testcapi}, |
| 144 | {"bsddb185", initbsddb185}, |
| 145 | {"bz2", initbz2}, |
| 146 | {"fpectl", initfpectl}, |
| 147 | {"fpetest", initfpetest}, |
| 148 | {"parser", initparser}, |
| 149 | {"pwd", initpwd}, |
Andrew MacIntyre | 631e87f | 2003-04-21 14:33:04 +0000 | [diff] [blame] | 150 | {"unicodedata", initunicodedata}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 151 | {"zlib", initzlib}, |
| 152 | #ifdef USE_SOCKET |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 153 | {"_socket", init_socket}, |
| 154 | {"select", initselect}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 155 | #endif |
| 156 | #endif |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 157 | /* -- ADDMODULE MARKER 2 -- */ |
| 158 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 159 | /* This module "lives in" with marshal.c */ |
| 160 | {"marshal", PyMarshal_Init}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 161 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 162 | /* This lives it with import.c */ |
| 163 | {"imp", initimp}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 164 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 165 | /* These entries are here for sys.builtin_module_names */ |
| 166 | {"__main__", NULL}, |
| 167 | {"__builtin__", NULL}, |
| 168 | {"sys", NULL}, |
| 169 | {"exceptions", NULL}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 170 | |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame] | 171 | /* This lives in gcmodule.c */ |
| 172 | {"gc", initgc}, |
| 173 | |
| 174 | /* Sentinel */ |
| 175 | {0, 0} |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 176 | }; |