Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 1 | /* Module configuration */ |
| 2 | |
| 3 | /* This file contains the table of built-in modules. |
| 4 | See init_builtin() in import.c. */ |
| 5 | |
| 6 | #include "Python.h" |
| 7 | |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 8 | extern void initarray(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 9 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 10 | extern void initaudioop(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 11 | #endif |
Trent Mick | c85eb0b | 2000-10-04 20:57:29 +0000 | [diff] [blame] | 12 | extern void initbinascii(void); |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 13 | extern void initcmath(void); |
| 14 | extern void initerrno(void); |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 15 | extern void initgc(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 16 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 17 | extern void initimageop(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 18 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 19 | extern void initmath(void); |
| 20 | extern void initmd5(void); |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 21 | extern void initnt(void); |
| 22 | extern void initoperator(void); |
| 23 | extern void initregex(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 24 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 25 | extern void initrgbimg(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 26 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 27 | extern void initrotor(void); |
| 28 | extern void initsignal(void); |
| 29 | extern void initsha(void); |
| 30 | extern void initstrop(void); |
| 31 | extern void initstruct(void); |
| 32 | extern void inittime(void); |
| 33 | extern void initthread(void); |
| 34 | extern void initcStringIO(void); |
| 35 | extern void initcPickle(void); |
| 36 | extern void initpcre(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 37 | #ifdef WIN32 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 38 | extern void initmsvcrt(void); |
| 39 | extern void init_locale(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 40 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 41 | extern void init_codecs(void); |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 42 | extern void initxreadlines(void); |
Tim Peters | 747d5b6 | 2001-02-02 00:07:07 +0000 | [diff] [blame] | 43 | extern void init_weakref(void); |
Tim Peters | 1566a17 | 2001-10-12 22:08:39 +0000 | [diff] [blame] | 44 | extern void init_hotshot(void); |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 45 | extern void initxxsubtype(void); |
Just van Rossum | 52e14d6 | 2002-12-30 22:08:05 +0000 | [diff] [blame] | 46 | extern void initzipimport(void); |
Tim Peters | d1f5ccc | 2002-12-29 23:46:40 +0000 | [diff] [blame] | 47 | extern void init_random(void); |
Raymond Hettinger | 96ef811 | 2003-02-01 00:10:11 +0000 | [diff] [blame] | 48 | extern void inititertools(void); |
Raymond Hettinger | 756b3f3 | 2004-01-29 06:37:52 +0000 | [diff] [blame] | 49 | extern void initcollections(void); |
Raymond Hettinger | b3af181 | 2003-11-08 10:24:38 +0000 | [diff] [blame] | 50 | extern void initheapq(void); |
Raymond Hettinger | 0c41027 | 2004-01-05 10:13:35 +0000 | [diff] [blame] | 51 | extern void init_bisect(void); |
Martin v. Löwis | 48918f7 | 2004-01-02 21:14:37 +0000 | [diff] [blame] | 52 | extern void init_symtable(void); |
| 53 | extern void initmmap(void); |
| 54 | extern void init_csv(void); |
| 55 | extern void init_sre(void); |
| 56 | extern void initparser(void); |
| 57 | extern void init_winreg(void); |
| 58 | extern void initdatetime(void); |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 59 | |
Martin v. Löwis | daea3e5 | 2004-01-21 07:54:02 +0000 | [diff] [blame] | 60 | extern void init_multibytecodec(void); |
| 61 | extern void init_codecs_mapdata_ja_JP(void); |
| 62 | extern void init_codecs_mapdata_ko_KR(void); |
| 63 | extern void init_codecs_mapdata_zh_CN(void); |
| 64 | extern void init_codecs_mapdata_zh_TW(void); |
| 65 | extern void init_codecs_shift_jis(void); |
| 66 | extern void init_codecs_cp932(void); |
| 67 | extern void init_codecs_euc_jp(void); |
| 68 | extern void init_codecs_iso2022_jp(void); |
| 69 | extern void init_codecs_iso2022_jp_1(void); |
| 70 | extern void init_codecs_iso2022_jp_2(void); |
| 71 | extern void init_codecs_iso2022_jp_3(void); |
| 72 | extern void init_codecs_iso2022_jp_ext(void); |
| 73 | extern void init_codecs_shift_jisx0213(void); |
| 74 | extern void init_codecs_euc_jisx0213(void); |
| 75 | extern void init_codecs_euc_kr(void); |
| 76 | extern void init_codecs_cp949(void); |
| 77 | extern void init_codecs_johab(void); |
| 78 | extern void init_codecs_iso2022_kr(void); |
| 79 | extern void init_codecs_gb2312(void); |
| 80 | extern void init_codecs_gbk(void); |
| 81 | extern void init_codecs_gb18030(void); |
| 82 | extern void init_codecs_hz(void); |
| 83 | extern void init_codecs_big5(void); |
| 84 | extern void init_codecs_cp950(void); |
| 85 | |
Martin v. Löwis | 6920652 | 2003-04-18 10:51:14 +0000 | [diff] [blame] | 86 | /* tools/freeze/makeconfig.py marker for additional "extern" */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 87 | /* -- ADDMODULE MARKER 1 -- */ |
| 88 | |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 89 | extern void PyMarshal_Init(void); |
| 90 | extern void initimp(void); |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 91 | |
Guido van Rossum | 2b713b2 | 1997-04-29 20:46:45 +0000 | [diff] [blame] | 92 | struct _inittab _PyImport_Inittab[] = { |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 93 | |
| 94 | {"array", initarray}, |
Guido van Rossum | 8f81a22 | 1999-02-05 22:34:57 +0000 | [diff] [blame] | 95 | #ifdef MS_WINDOWS |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 96 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 97 | {"audioop", initaudioop}, |
| 98 | #endif |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 99 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 100 | {"binascii", initbinascii}, |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 101 | {"cmath", initcmath}, |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 102 | {"errno", initerrno}, |
Jeremy Hylton | c5007aa | 2000-06-30 05:02:53 +0000 | [diff] [blame] | 103 | {"gc", initgc}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 104 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 105 | {"imageop", initimageop}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 106 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 107 | {"math", initmath}, |
| 108 | {"md5", initmd5}, |
Guido van Rossum | 2e146b3 | 1997-05-06 16:00:32 +0000 | [diff] [blame] | 109 | {"nt", initnt}, /* Use the NT os functions, not posix */ |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 110 | {"operator", initoperator}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 111 | {"regex", initregex}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 112 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 113 | {"rgbimg", initrgbimg}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 114 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 115 | {"rotor", initrotor}, |
| 116 | {"signal", initsignal}, |
Guido van Rossum | be211a5 | 1999-04-13 15:41:10 +0000 | [diff] [blame] | 117 | {"sha", initsha}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 118 | {"strop", initstrop}, |
| 119 | {"struct", initstruct}, |
| 120 | {"time", inittime}, |
Guido van Rossum | bf57ed5 | 1996-08-22 00:43:42 +0000 | [diff] [blame] | 121 | #ifdef WITH_THREAD |
| 122 | {"thread", initthread}, |
| 123 | #endif |
Guido van Rossum | 2e146b3 | 1997-05-06 16:00:32 +0000 | [diff] [blame] | 124 | {"cStringIO", initcStringIO}, |
| 125 | {"cPickle", initcPickle}, |
Guido van Rossum | 36e18e3 | 1997-11-25 06:00:59 +0000 | [diff] [blame] | 126 | {"pcre", initpcre}, |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 127 | #ifdef WIN32 |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 128 | {"msvcrt", initmsvcrt}, |
| 129 | {"_locale", init_locale}, |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 130 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 131 | |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 132 | {"_codecs", init_codecs}, |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 133 | {"xreadlines", initxreadlines}, |
Tim Peters | 747d5b6 | 2001-02-02 00:07:07 +0000 | [diff] [blame] | 134 | {"_weakref", init_weakref}, |
Tim Peters | 1566a17 | 2001-10-12 22:08:39 +0000 | [diff] [blame] | 135 | {"_hotshot", init_hotshot}, |
Tim Peters | d1f5ccc | 2002-12-29 23:46:40 +0000 | [diff] [blame] | 136 | {"_random", init_random}, |
Raymond Hettinger | 0c41027 | 2004-01-05 10:13:35 +0000 | [diff] [blame] | 137 | {"_bisect", init_bisect}, |
Raymond Hettinger | b3af181 | 2003-11-08 10:24:38 +0000 | [diff] [blame] | 138 | {"heapq", initheapq}, |
Raymond Hettinger | 96ef811 | 2003-02-01 00:10:11 +0000 | [diff] [blame] | 139 | {"itertools", inititertools}, |
Raymond Hettinger | 756b3f3 | 2004-01-29 06:37:52 +0000 | [diff] [blame] | 140 | {"collections", initcollections}, |
Martin v. Löwis | 48918f7 | 2004-01-02 21:14:37 +0000 | [diff] [blame] | 141 | {"_symtable", init_symtable}, |
| 142 | {"mmap", initmmap}, |
| 143 | {"_csv", init_csv}, |
| 144 | {"_sre", init_sre}, |
| 145 | {"parser", initparser}, |
| 146 | {"_winreg", init_winreg}, |
| 147 | {"datetime", initdatetime}, |
Guido van Rossum | 76bd689 | 2000-03-11 00:13:14 +0000 | [diff] [blame] | 148 | |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 149 | {"xxsubtype", initxxsubtype}, |
Just van Rossum | 52e14d6 | 2002-12-30 22:08:05 +0000 | [diff] [blame] | 150 | {"zipimport", initzipimport}, |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 151 | |
Martin v. Löwis | daea3e5 | 2004-01-21 07:54:02 +0000 | [diff] [blame] | 152 | /* CJK codecs */ |
| 153 | {"_multibytecodec", init_multibytecodec}, |
| 154 | {"_codecs_mapdata_ja_JP", init_codecs_mapdata_ja_JP}, |
| 155 | {"_codecs_mapdata_ko_KR", init_codecs_mapdata_ko_KR}, |
| 156 | {"_codecs_mapdata_zh_CN", init_codecs_mapdata_zh_CN}, |
| 157 | {"_codecs_mapdata_zh_TW", init_codecs_mapdata_zh_TW}, |
| 158 | {"_codecs_shift_jis", init_codecs_shift_jis}, |
| 159 | {"_codecs_cp932", init_codecs_cp932}, |
| 160 | {"_codecs_euc_jp", init_codecs_euc_jp}, |
| 161 | {"_codecs_iso2022_jp", init_codecs_iso2022_jp}, |
| 162 | {"_codecs_iso2022_jp_1", init_codecs_iso2022_jp_1}, |
| 163 | {"_codecs_iso2022_jp_2", init_codecs_iso2022_jp_2}, |
| 164 | {"_codecs_iso2022_jp_3", init_codecs_iso2022_jp_3}, |
| 165 | {"_codecs_iso2022_jp_ext", init_codecs_iso2022_jp_ext}, |
| 166 | {"_codecs_shift_jisx0213", init_codecs_shift_jisx0213}, |
| 167 | {"_codecs_euc_jisx0213", init_codecs_euc_jisx0213}, |
| 168 | {"_codecs_euc_kr", init_codecs_euc_kr}, |
| 169 | {"_codecs_cp949", init_codecs_cp949}, |
| 170 | {"_codecs_johab", init_codecs_johab}, |
| 171 | {"_codecs_iso2022_kr", init_codecs_iso2022_kr}, |
| 172 | {"_codecs_gb2312", init_codecs_gb2312}, |
| 173 | {"_codecs_gbk", init_codecs_gbk}, |
| 174 | {"_codecs_gb18030", init_codecs_gb18030}, |
| 175 | {"_codecs_hz", init_codecs_hz}, |
| 176 | {"_codecs_big5", init_codecs_big5}, |
| 177 | {"_codecs_cp950", init_codecs_cp950}, |
| 178 | |
Martin v. Löwis | 6920652 | 2003-04-18 10:51:14 +0000 | [diff] [blame] | 179 | /* tools/freeze/makeconfig.py marker for additional "_inittab" entries */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 180 | /* -- ADDMODULE MARKER 2 -- */ |
| 181 | |
| 182 | /* This module "lives in" with marshal.c */ |
| 183 | {"marshal", PyMarshal_Init}, |
| 184 | |
| 185 | /* This lives it with import.c */ |
| 186 | {"imp", initimp}, |
| 187 | |
| 188 | /* These entries are here for sys.builtin_module_names */ |
| 189 | {"__main__", NULL}, |
| 190 | {"__builtin__", NULL}, |
| 191 | {"sys", NULL}, |
Guido van Rossum | f981c8f | 2000-07-12 12:11:36 +0000 | [diff] [blame] | 192 | {"exceptions", NULL}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 193 | |
| 194 | /* Sentinel */ |
| 195 | {0, 0} |
| 196 | }; |