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