blob: 66bf4580a01220499253e71b0222e4d13fd3b99f [file] [log] [blame]
Guido van Rossum87d5e701996-05-28 22:50:17 +00001/* Module configuration */
2
3/* This file contains the table of built-in modules.
Nick Coghland5cacbb2015-05-23 22:24:10 +10004 See create_builtin() in import.c. */
Guido van Rossum87d5e701996-05-28 22:50:17 +00005
6#include "Python.h"
7
Martin v. Löwis6a880a82008-06-11 05:48:29 +00008extern PyObject* PyInit_array(void);
Guido van Rossum360e4b82007-05-14 22:51:27 +00009#ifndef MS_WINI64
Martin v. Löwis6a880a82008-06-11 05:48:29 +000010extern PyObject* PyInit_audioop(void);
Guido van Rossum23ef82f2000-05-08 14:15:19 +000011#endif
Martin v. Löwis6a880a82008-06-11 05:48:29 +000012extern PyObject* PyInit_binascii(void);
13extern PyObject* PyInit_cmath(void);
14extern PyObject* PyInit_errno(void);
Victor Stinner024e37a2011-03-31 01:31:06 +020015extern PyObject* PyInit_faulthandler(void);
Victor Stinnered3b0bc2013-11-23 12:27:24 +010016extern PyObject* PyInit__tracemalloc(void);
Martin v. Löwis6a880a82008-06-11 05:48:29 +000017extern PyObject* PyInit_gc(void);
18extern PyObject* PyInit_math(void);
19extern PyObject* PyInit__md5(void);
20extern PyObject* PyInit_nt(void);
Antoine Pitroua85017f2013-04-20 19:21:44 +020021extern PyObject* PyInit__operator(void);
Giampaolo Rodola'e09fb712014-04-04 15:34:17 +020022extern PyObject* PyInit__signal(void);
Martin v. Löwis6a880a82008-06-11 05:48:29 +000023extern PyObject* PyInit__sha1(void);
24extern PyObject* PyInit__sha256(void);
25extern PyObject* PyInit__sha512(void);
26extern PyObject* PyInit_time(void);
27extern PyObject* PyInit__thread(void);
Guido van Rossum29c1ea51997-08-07 00:11:34 +000028#ifdef WIN32
Martin v. Löwis6a880a82008-06-11 05:48:29 +000029extern PyObject* PyInit_msvcrt(void);
30extern PyObject* PyInit__locale(void);
Guido van Rossum29c1ea51997-08-07 00:11:34 +000031#endif
Martin v. Löwis6a880a82008-06-11 05:48:29 +000032extern PyObject* PyInit__codecs(void);
33extern PyObject* PyInit__weakref(void);
34extern PyObject* PyInit_xxsubtype(void);
35extern PyObject* PyInit_zipimport(void);
36extern PyObject* PyInit__random(void);
37extern PyObject* PyInit_itertools(void);
38extern PyObject* PyInit__collections(void);
39extern PyObject* PyInit__heapq(void);
40extern PyObject* PyInit__bisect(void);
41extern PyObject* PyInit__symtable(void);
42extern PyObject* PyInit_mmap(void);
43extern PyObject* PyInit__csv(void);
44extern PyObject* PyInit__sre(void);
45extern PyObject* PyInit_parser(void);
46extern PyObject* PyInit_winreg(void);
47extern PyObject* PyInit__struct(void);
Alexander Belopolskycf86e362010-07-23 19:25:47 +000048extern PyObject* PyInit__datetime(void);
Martin v. Löwis6a880a82008-06-11 05:48:29 +000049extern PyObject* PyInit__functools(void);
50extern PyObject* PyInit__json(void);
51extern PyObject* PyInit_zlib(void);
Guido van Rossum87d5e701996-05-28 22:50:17 +000052
Martin v. Löwis6a880a82008-06-11 05:48:29 +000053extern PyObject* PyInit__multibytecodec(void);
54extern PyObject* PyInit__codecs_cn(void);
55extern PyObject* PyInit__codecs_hk(void);
56extern PyObject* PyInit__codecs_iso2022(void);
57extern PyObject* PyInit__codecs_jp(void);
58extern PyObject* PyInit__codecs_kr(void);
59extern PyObject* PyInit__codecs_tw(void);
Antoine Pitrou23bba4c2012-04-18 20:51:15 +020060extern PyObject* PyInit__winapi(void);
Martin v. Löwis6a880a82008-06-11 05:48:29 +000061extern PyObject* PyInit__lsprof(void);
62extern PyObject* PyInit__ast(void);
Benjamin Peterson4fa88fa2009-03-04 00:14:51 +000063extern PyObject* PyInit__io(void);
Amaury Forgeot d'Arc9d865c92008-06-12 22:27:27 +000064extern PyObject* PyInit__pickle(void);
Martin v. Löwis6a880a82008-06-11 05:48:29 +000065extern PyObject* PyInit_atexit(void);
66extern PyObject* _PyWarnings_Init(void);
Georg Brandl66c221e2010-10-14 07:04:07 +000067extern PyObject* PyInit__string(void);
Christian Heimesc44ff862013-06-23 15:46:56 +020068extern PyObject* PyInit__stat(void);
Christian Heimes71135ac2013-11-24 01:11:57 +010069extern PyObject* PyInit__opcode(void);
Martin v. Löwisdaea3e52004-01-21 07:54:02 +000070
Martin v. Löwis69206522003-04-18 10:51:14 +000071/* tools/freeze/makeconfig.py marker for additional "extern" */
Guido van Rossum87d5e701996-05-28 22:50:17 +000072/* -- ADDMODULE MARKER 1 -- */
73
Martin v. Löwis6a880a82008-06-11 05:48:29 +000074extern PyObject* PyMarshal_Init(void);
75extern PyObject* PyInit_imp(void);
Guido van Rossum87d5e701996-05-28 22:50:17 +000076
Guido van Rossum2b713b21997-04-29 20:46:45 +000077struct _inittab _PyImport_Inittab[] = {
Guido van Rossum87d5e701996-05-28 22:50:17 +000078
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000079 {"array", PyInit_array},
80 {"_ast", PyInit__ast},
Guido van Rossum8f81a221999-02-05 22:34:57 +000081#ifdef MS_WINDOWS
Guido van Rossum360e4b82007-05-14 22:51:27 +000082#ifndef MS_WINI64
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000083 {"audioop", PyInit_audioop},
Guido van Rossum87d5e701996-05-28 22:50:17 +000084#endif
Guido van Rossum23ef82f2000-05-08 14:15:19 +000085#endif
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000086 {"binascii", PyInit_binascii},
87 {"cmath", PyInit_cmath},
88 {"errno", PyInit_errno},
Victor Stinner024e37a2011-03-31 01:31:06 +020089 {"faulthandler", PyInit_faulthandler},
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000090 {"gc", PyInit_gc},
91 {"math", PyInit_math},
92 {"nt", PyInit_nt}, /* Use the NT os functions, not posix */
Antoine Pitroua85017f2013-04-20 19:21:44 +020093 {"_operator", PyInit__operator},
Brett Cannonbe9acef2014-04-04 10:36:43 -040094 {"_signal", PyInit__signal},
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000095 {"_md5", PyInit__md5},
96 {"_sha1", PyInit__sha1},
97 {"_sha256", PyInit__sha256},
98 {"_sha512", PyInit__sha512},
99 {"time", PyInit_time},
Guido van Rossumbf57ed51996-08-22 00:43:42 +0000100#ifdef WITH_THREAD
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000101 {"_thread", PyInit__thread},
Guido van Rossumbf57ed51996-08-22 00:43:42 +0000102#endif
Guido van Rossum29c1ea51997-08-07 00:11:34 +0000103#ifdef WIN32
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000104 {"msvcrt", PyInit_msvcrt},
105 {"_locale", PyInit__locale},
Guido van Rossum29c1ea51997-08-07 00:11:34 +0000106#endif
Victor Stinnered3b0bc2013-11-23 12:27:24 +0100107 {"_tracemalloc", PyInit__tracemalloc},
Antoine Pitrou23bba4c2012-04-18 20:51:15 +0200108 /* XXX Should _winapi go in a WIN32 block? not WIN64? */
109 {"_winapi", PyInit__winapi},
Guido van Rossum87d5e701996-05-28 22:50:17 +0000110
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000111 {"_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 Belopolskycf86e362010-07-23 19:25:47 +0000126 {"_datetime", PyInit__datetime},
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000127 {"_functools", PyInit__functools},
128 {"_json", PyInit__json},
Guido van Rossum76bd6892000-03-11 00:13:14 +0000129
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000130 {"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öwisdaea3e52004-01-21 07:54:02 +0000142
Martin v. Löwis69206522003-04-18 10:51:14 +0000143/* tools/freeze/makeconfig.py marker for additional "_inittab" entries */
Guido van Rossum87d5e701996-05-28 22:50:17 +0000144/* -- ADDMODULE MARKER 2 -- */
145
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000146 /* This module "lives in" with marshal.c */
147 {"marshal", PyMarshal_Init},
Guido van Rossum87d5e701996-05-28 22:50:17 +0000148
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000149 /* This lives it with import.c */
Brett Cannon6f44d662012-04-15 16:08:47 -0400150 {"_imp", PyInit_imp},
Guido van Rossum87d5e701996-05-28 22:50:17 +0000151
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000152 /* These entries are here for sys.builtin_module_names */
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000153 {"builtins", NULL},
154 {"sys", NULL},
155 {"_warnings", _PyWarnings_Init},
Georg Brandl66c221e2010-10-14 07:04:07 +0000156 {"_string", PyInit__string},
Christian Heimes33fe8092008-04-13 13:53:33 +0000157
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000158 {"_io", PyInit__io},
159 {"_pickle", PyInit__pickle},
160 {"atexit", PyInit_atexit},
Christian Heimesc44ff862013-06-23 15:46:56 +0200161 {"_stat", PyInit__stat},
Christian Heimes71135ac2013-11-24 01:11:57 +0100162 {"_opcode", PyInit__opcode},
Guido van Rossum87d5e701996-05-28 22:50:17 +0000163
Antoine Pitrouf95a1b32010-05-09 15:52:27 +0000164 /* Sentinel */
165 {0, 0}
Guido van Rossum87d5e701996-05-28 22:50:17 +0000166};