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