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 |
| 44 | #if !HAVE_DYNAMIC_LOADING |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 45 | extern void init_codecs(); |
| 46 | extern void init_curses(); |
| 47 | extern void init_curses_panel(); |
| 48 | extern void init_hotshot(); |
| 49 | extern void init_locale(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 50 | extern void init_random(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 51 | extern void init_sre(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 52 | extern void init_symtable(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 53 | extern void init_testcapi(); |
| 54 | extern void init_weakref(); |
| 55 | extern void initarray(); |
| 56 | extern void initbinascii(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 57 | extern void initbsddb185(); |
| 58 | extern void initbz2(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 59 | extern void initcPickle(); |
| 60 | extern void initcStringIO(); |
| 61 | extern void initcmath(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 62 | extern void initdatetime(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 63 | extern void initdl(); |
| 64 | extern void initerrno(); |
| 65 | extern void initfcntl(); |
| 66 | extern void initfpectl(); |
| 67 | extern void initfpetest(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 68 | extern void initimageop(); |
| 69 | extern void initmath(); |
| 70 | extern void initmd5(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 71 | extern void initoperator(); |
| 72 | extern void initparser(); |
| 73 | extern void initpcre(); |
| 74 | extern void initpwd(); |
| 75 | extern void initregex(); |
| 76 | extern void initrgbimg(); |
| 77 | extern void initrotor(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 78 | extern void initsha(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 79 | extern void initstrop(); |
| 80 | extern void initstruct(); |
| 81 | extern void inittermios(); |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 82 | extern void inittime(); |
| 83 | extern void inittiming(); |
| 84 | extern void initunicodedata(); |
| 85 | extern void initxreadlines(); |
Andrew MacIntyre | 4a79e36 | 2002-06-10 08:04:29 +0000 | [diff] [blame] | 86 | extern void initxxsubtype(); |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 87 | extern void initzipimport(); |
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 |
| 107 | #if !HAVE_DYNAMIC_LOADING |
| 108 | {"_codecs", init_codecs}, |
| 109 | {"_curses", init_curses}, |
| 110 | {"_curses_panel", init_curses_panel}, |
| 111 | {"_hotshot", init_hotshot}, |
| 112 | {"_locale", init_locale}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 113 | {"_random", init_random}, |
| 114 | {"_sre", init_sre}, |
| 115 | {"_symtable", init_symtable}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 116 | {"_testcapi", init_testcapi}, |
| 117 | {"_weakref", init_weakref}, |
| 118 | {"array", initarray}, |
| 119 | {"binascii", initbinascii}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 120 | {"bsddb185", initbsddb185}, |
| 121 | {"bz2", initbz2}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 122 | {"cPickle", initcPickle}, |
| 123 | {"cStringIO", initcStringIO}, |
| 124 | {"cmath", initcmath}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 125 | {"datetime", initdatetime}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 126 | {"dl", initdl}, |
| 127 | {"errno", initerrno}, |
| 128 | {"fcntl", initfcntl}, |
| 129 | {"fpectl", initfpectl}, |
| 130 | {"fpetest", initfpetest}, |
| 131 | {"imageop", initimageop}, |
| 132 | {"math", initmath}, |
| 133 | {"md5", initmd5}, |
Andrew MacIntyre | 41d97d6 | 2002-02-17 05:23:30 +0000 | [diff] [blame] | 134 | {"operator", initoperator}, |
| 135 | {"parser", initparser}, |
| 136 | {"pcre", initpcre}, |
| 137 | {"pwd", initpwd}, |
| 138 | {"regex", initregex}, |
| 139 | {"rgbimg", initrgbimg}, |
| 140 | {"rotor", initrotor}, |
| 141 | {"sha", initsha}, |
| 142 | {"strop", initstrop}, |
| 143 | {"struct", initstruct}, |
| 144 | {"termios", inittermios}, |
| 145 | {"time", inittime}, |
| 146 | {"timing", inittiming}, |
| 147 | {"unicodedata", initunicodedata}, |
| 148 | {"xreadlines", initxreadlines}, |
Andrew MacIntyre | 4a79e36 | 2002-06-10 08:04:29 +0000 | [diff] [blame] | 149 | {"xxsubtype", initxxsubtype}, |
Andrew MacIntyre | 5180123 | 2003-01-02 12:40:41 +0000 | [diff] [blame^] | 150 | {"zipimport", initzipimport}, |
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 | }; |