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