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. |
Nick Coghlan | d5cacbb | 2015-05-23 22:24:10 +1000 | [diff] [blame] | 4 | See create_builtin() in import.c. */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 5 | |
| 6 | #include "Python.h" |
| 7 | |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 8 | extern PyObject* PyInit_array(void); |
Guido van Rossum | 360e4b8 | 2007-05-14 22:51:27 +0000 | [diff] [blame] | 9 | #ifndef MS_WINI64 |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 10 | extern PyObject* PyInit_audioop(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 11 | #endif |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 12 | extern PyObject* PyInit_binascii(void); |
| 13 | extern PyObject* PyInit_cmath(void); |
| 14 | extern PyObject* PyInit_errno(void); |
Victor Stinner | 024e37a | 2011-03-31 01:31:06 +0200 | [diff] [blame] | 15 | extern PyObject* PyInit_faulthandler(void); |
Victor Stinner | ed3b0bc | 2013-11-23 12:27:24 +0100 | [diff] [blame] | 16 | extern PyObject* PyInit__tracemalloc(void); |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 17 | extern PyObject* PyInit_gc(void); |
| 18 | extern PyObject* PyInit_math(void); |
| 19 | extern PyObject* PyInit__md5(void); |
| 20 | extern PyObject* PyInit_nt(void); |
Antoine Pitrou | a85017f | 2013-04-20 19:21:44 +0200 | [diff] [blame] | 21 | extern PyObject* PyInit__operator(void); |
Giampaolo Rodola' | e09fb71 | 2014-04-04 15:34:17 +0200 | [diff] [blame] | 22 | extern PyObject* PyInit__signal(void); |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 23 | extern PyObject* PyInit__sha1(void); |
| 24 | extern PyObject* PyInit__sha256(void); |
| 25 | extern PyObject* PyInit__sha512(void); |
Christian Heimes | 6fe2a75 | 2016-09-07 11:58:24 +0200 | [diff] [blame] | 26 | extern PyObject* PyInit__sha3(void); |
Christian Heimes | 7ba8337 | 2016-09-07 01:45:22 +0200 | [diff] [blame] | 27 | extern PyObject* PyInit__blake2(void); |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 28 | extern PyObject* PyInit_time(void); |
| 29 | extern PyObject* PyInit__thread(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 30 | #ifdef WIN32 |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 31 | extern PyObject* PyInit_msvcrt(void); |
| 32 | extern PyObject* PyInit__locale(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 33 | #endif |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 34 | extern PyObject* PyInit__codecs(void); |
| 35 | extern PyObject* PyInit__weakref(void); |
| 36 | extern PyObject* PyInit_xxsubtype(void); |
| 37 | extern PyObject* PyInit_zipimport(void); |
| 38 | extern PyObject* PyInit__random(void); |
| 39 | extern PyObject* PyInit_itertools(void); |
| 40 | extern PyObject* PyInit__collections(void); |
| 41 | extern PyObject* PyInit__heapq(void); |
| 42 | extern PyObject* PyInit__bisect(void); |
| 43 | extern PyObject* PyInit__symtable(void); |
| 44 | extern PyObject* PyInit_mmap(void); |
| 45 | extern PyObject* PyInit__csv(void); |
| 46 | extern PyObject* PyInit__sre(void); |
| 47 | extern PyObject* PyInit_parser(void); |
| 48 | extern PyObject* PyInit_winreg(void); |
| 49 | extern PyObject* PyInit__struct(void); |
Alexander Belopolsky | cf86e36 | 2010-07-23 19:25:47 +0000 | [diff] [blame] | 50 | extern PyObject* PyInit__datetime(void); |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 51 | extern PyObject* PyInit__functools(void); |
| 52 | extern PyObject* PyInit__json(void); |
| 53 | extern PyObject* PyInit_zlib(void); |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 54 | |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 55 | extern PyObject* PyInit__multibytecodec(void); |
| 56 | extern PyObject* PyInit__codecs_cn(void); |
| 57 | extern PyObject* PyInit__codecs_hk(void); |
| 58 | extern PyObject* PyInit__codecs_iso2022(void); |
| 59 | extern PyObject* PyInit__codecs_jp(void); |
| 60 | extern PyObject* PyInit__codecs_kr(void); |
| 61 | extern PyObject* PyInit__codecs_tw(void); |
Antoine Pitrou | 23bba4c | 2012-04-18 20:51:15 +0200 | [diff] [blame] | 62 | extern PyObject* PyInit__winapi(void); |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 63 | extern PyObject* PyInit__lsprof(void); |
| 64 | extern PyObject* PyInit__ast(void); |
Benjamin Peterson | 4fa88fa | 2009-03-04 00:14:51 +0000 | [diff] [blame] | 65 | extern PyObject* PyInit__io(void); |
Amaury Forgeot d'Arc | 9d865c9 | 2008-06-12 22:27:27 +0000 | [diff] [blame] | 66 | extern PyObject* PyInit__pickle(void); |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 67 | extern PyObject* PyInit_atexit(void); |
| 68 | extern PyObject* _PyWarnings_Init(void); |
Georg Brandl | 66c221e | 2010-10-14 07:04:07 +0000 | [diff] [blame] | 69 | extern PyObject* PyInit__string(void); |
Christian Heimes | c44ff86 | 2013-06-23 15:46:56 +0200 | [diff] [blame] | 70 | extern PyObject* PyInit__stat(void); |
Christian Heimes | 71135ac | 2013-11-24 01:11:57 +0100 | [diff] [blame] | 71 | extern PyObject* PyInit__opcode(void); |
Martin v. Löwis | daea3e5 | 2004-01-21 07:54:02 +0000 | [diff] [blame] | 72 | |
Martin v. Löwis | 6920652 | 2003-04-18 10:51:14 +0000 | [diff] [blame] | 73 | /* tools/freeze/makeconfig.py marker for additional "extern" */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 74 | /* -- ADDMODULE MARKER 1 -- */ |
| 75 | |
Martin v. Löwis | 6a880a8 | 2008-06-11 05:48:29 +0000 | [diff] [blame] | 76 | extern PyObject* PyMarshal_Init(void); |
| 77 | extern PyObject* PyInit_imp(void); |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 78 | |
Guido van Rossum | 2b713b2 | 1997-04-29 20:46:45 +0000 | [diff] [blame] | 79 | struct _inittab _PyImport_Inittab[] = { |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 80 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 81 | {"array", PyInit_array}, |
| 82 | {"_ast", PyInit__ast}, |
Guido van Rossum | 8f81a22 | 1999-02-05 22:34:57 +0000 | [diff] [blame] | 83 | #ifdef MS_WINDOWS |
Guido van Rossum | 360e4b8 | 2007-05-14 22:51:27 +0000 | [diff] [blame] | 84 | #ifndef MS_WINI64 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 85 | {"audioop", PyInit_audioop}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 86 | #endif |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 87 | #endif |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 88 | {"binascii", PyInit_binascii}, |
| 89 | {"cmath", PyInit_cmath}, |
| 90 | {"errno", PyInit_errno}, |
Victor Stinner | 024e37a | 2011-03-31 01:31:06 +0200 | [diff] [blame] | 91 | {"faulthandler", PyInit_faulthandler}, |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 92 | {"gc", PyInit_gc}, |
| 93 | {"math", PyInit_math}, |
| 94 | {"nt", PyInit_nt}, /* Use the NT os functions, not posix */ |
Antoine Pitrou | a85017f | 2013-04-20 19:21:44 +0200 | [diff] [blame] | 95 | {"_operator", PyInit__operator}, |
Brett Cannon | be9acef | 2014-04-04 10:36:43 -0400 | [diff] [blame] | 96 | {"_signal", PyInit__signal}, |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 97 | {"_md5", PyInit__md5}, |
| 98 | {"_sha1", PyInit__sha1}, |
| 99 | {"_sha256", PyInit__sha256}, |
| 100 | {"_sha512", PyInit__sha512}, |
Christian Heimes | 6fe2a75 | 2016-09-07 11:58:24 +0200 | [diff] [blame] | 101 | {"_sha3", PyInit__sha3}, |
Christian Heimes | 7ba8337 | 2016-09-07 01:45:22 +0200 | [diff] [blame] | 102 | {"_blake2", PyInit__blake2}, |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 103 | {"time", PyInit_time}, |
Guido van Rossum | bf57ed5 | 1996-08-22 00:43:42 +0000 | [diff] [blame] | 104 | #ifdef WITH_THREAD |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 105 | {"_thread", PyInit__thread}, |
Guido van Rossum | bf57ed5 | 1996-08-22 00:43:42 +0000 | [diff] [blame] | 106 | #endif |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 107 | #ifdef WIN32 |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 108 | {"msvcrt", PyInit_msvcrt}, |
| 109 | {"_locale", PyInit__locale}, |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 110 | #endif |
Victor Stinner | ed3b0bc | 2013-11-23 12:27:24 +0100 | [diff] [blame] | 111 | {"_tracemalloc", PyInit__tracemalloc}, |
Antoine Pitrou | 23bba4c | 2012-04-18 20:51:15 +0200 | [diff] [blame] | 112 | /* XXX Should _winapi go in a WIN32 block? not WIN64? */ |
| 113 | {"_winapi", PyInit__winapi}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 114 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 115 | {"_codecs", PyInit__codecs}, |
| 116 | {"_weakref", PyInit__weakref}, |
| 117 | {"_random", PyInit__random}, |
| 118 | {"_bisect", PyInit__bisect}, |
| 119 | {"_heapq", PyInit__heapq}, |
| 120 | {"_lsprof", PyInit__lsprof}, |
| 121 | {"itertools", PyInit_itertools}, |
| 122 | {"_collections", PyInit__collections}, |
| 123 | {"_symtable", PyInit__symtable}, |
| 124 | {"mmap", PyInit_mmap}, |
| 125 | {"_csv", PyInit__csv}, |
| 126 | {"_sre", PyInit__sre}, |
| 127 | {"parser", PyInit_parser}, |
| 128 | {"winreg", PyInit_winreg}, |
| 129 | {"_struct", PyInit__struct}, |
Alexander Belopolsky | cf86e36 | 2010-07-23 19:25:47 +0000 | [diff] [blame] | 130 | {"_datetime", PyInit__datetime}, |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 131 | {"_functools", PyInit__functools}, |
| 132 | {"_json", PyInit__json}, |
Guido van Rossum | 76bd689 | 2000-03-11 00:13:14 +0000 | [diff] [blame] | 133 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 134 | {"xxsubtype", PyInit_xxsubtype}, |
| 135 | {"zipimport", PyInit_zipimport}, |
| 136 | {"zlib", PyInit_zlib}, |
| 137 | |
| 138 | /* CJK codecs */ |
| 139 | {"_multibytecodec", PyInit__multibytecodec}, |
| 140 | {"_codecs_cn", PyInit__codecs_cn}, |
| 141 | {"_codecs_hk", PyInit__codecs_hk}, |
| 142 | {"_codecs_iso2022", PyInit__codecs_iso2022}, |
| 143 | {"_codecs_jp", PyInit__codecs_jp}, |
| 144 | {"_codecs_kr", PyInit__codecs_kr}, |
| 145 | {"_codecs_tw", PyInit__codecs_tw}, |
Martin v. Löwis | daea3e5 | 2004-01-21 07:54:02 +0000 | [diff] [blame] | 146 | |
Martin v. Löwis | 6920652 | 2003-04-18 10:51:14 +0000 | [diff] [blame] | 147 | /* tools/freeze/makeconfig.py marker for additional "_inittab" entries */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 148 | /* -- ADDMODULE MARKER 2 -- */ |
| 149 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 150 | /* This module "lives in" with marshal.c */ |
| 151 | {"marshal", PyMarshal_Init}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 152 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 153 | /* This lives it with import.c */ |
Brett Cannon | 6f44d66 | 2012-04-15 16:08:47 -0400 | [diff] [blame] | 154 | {"_imp", PyInit_imp}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 155 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 156 | /* These entries are here for sys.builtin_module_names */ |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 157 | {"builtins", NULL}, |
| 158 | {"sys", NULL}, |
| 159 | {"_warnings", _PyWarnings_Init}, |
Georg Brandl | 66c221e | 2010-10-14 07:04:07 +0000 | [diff] [blame] | 160 | {"_string", PyInit__string}, |
Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 161 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 162 | {"_io", PyInit__io}, |
| 163 | {"_pickle", PyInit__pickle}, |
| 164 | {"atexit", PyInit_atexit}, |
Christian Heimes | c44ff86 | 2013-06-23 15:46:56 +0200 | [diff] [blame] | 165 | {"_stat", PyInit__stat}, |
Christian Heimes | 71135ac | 2013-11-24 01:11:57 +0100 | [diff] [blame] | 166 | {"_opcode", PyInit__opcode}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 167 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 168 | /* Sentinel */ |
| 169 | {0, 0} |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 170 | }; |