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