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 | |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 8 | extern void initarray(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 9 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 10 | extern void initaudioop(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 11 | #endif |
Trent Mick | c85eb0b | 2000-10-04 20:57:29 +0000 | [diff] [blame] | 12 | extern void initbinascii(void); |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 13 | extern void initcmath(void); |
| 14 | extern void initerrno(void); |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 15 | extern void initgc(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 16 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 17 | extern void initimageop(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 18 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 19 | extern void initmath(void); |
| 20 | extern void initmd5(void); |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 21 | extern void initnt(void); |
| 22 | extern void initoperator(void); |
| 23 | extern void initregex(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 24 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 25 | extern void initrgbimg(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 26 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 27 | extern void initrotor(void); |
| 28 | extern void initsignal(void); |
| 29 | extern void initsha(void); |
| 30 | extern void initstrop(void); |
| 31 | extern void initstruct(void); |
| 32 | extern void inittime(void); |
| 33 | extern void initthread(void); |
| 34 | extern void initcStringIO(void); |
| 35 | extern void initcPickle(void); |
| 36 | extern void initpcre(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 37 | #ifdef WIN32 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 38 | extern void initmsvcrt(void); |
| 39 | extern void init_locale(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 40 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 41 | extern void init_codecs(void); |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 42 | extern void initxreadlines(void); |
Tim Peters | 747d5b6 | 2001-02-02 00:07:07 +0000 | [diff] [blame] | 43 | extern void init_weakref(void); |
Tim Peters | 1566a17 | 2001-10-12 22:08:39 +0000 | [diff] [blame] | 44 | extern void init_hotshot(void); |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 45 | extern void initxxsubtype(void); |
Just van Rossum | 52e14d6 | 2002-12-30 22:08:05 +0000 | [diff] [blame] | 46 | extern void initzipimport(void); |
Tim Peters | d1f5ccc | 2002-12-29 23:46:40 +0000 | [diff] [blame] | 47 | extern void init_random(void); |
Raymond Hettinger | 96ef811 | 2003-02-01 00:10:11 +0000 | [diff] [blame] | 48 | extern void inititertools(void); |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 49 | |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 50 | /* XXX tim: what's the purpose of ADDMODULE MARKER? */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 51 | /* -- ADDMODULE MARKER 1 -- */ |
| 52 | |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 53 | extern void PyMarshal_Init(void); |
| 54 | extern void initimp(void); |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 55 | |
Guido van Rossum | 2b713b2 | 1997-04-29 20:46:45 +0000 | [diff] [blame] | 56 | struct _inittab _PyImport_Inittab[] = { |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 57 | |
| 58 | {"array", initarray}, |
Guido van Rossum | 8f81a22 | 1999-02-05 22:34:57 +0000 | [diff] [blame] | 59 | #ifdef MS_WINDOWS |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 60 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 61 | {"audioop", initaudioop}, |
| 62 | #endif |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 63 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 64 | {"binascii", initbinascii}, |
Guido van Rossum | 1bc716f | 1996-06-28 19:12:06 +0000 | [diff] [blame] | 65 | {"cmath", initcmath}, |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 66 | {"errno", initerrno}, |
Jeremy Hylton | c5007aa | 2000-06-30 05:02:53 +0000 | [diff] [blame] | 67 | {"gc", initgc}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 68 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 69 | {"imageop", initimageop}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 70 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 71 | {"math", initmath}, |
| 72 | {"md5", initmd5}, |
Guido van Rossum | 2e146b3 | 1997-05-06 16:00:32 +0000 | [diff] [blame] | 73 | {"nt", initnt}, /* Use the NT os functions, not posix */ |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 74 | {"operator", initoperator}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 75 | {"regex", initregex}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 76 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 77 | {"rgbimg", initrgbimg}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 78 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 79 | {"rotor", initrotor}, |
| 80 | {"signal", initsignal}, |
Guido van Rossum | be211a5 | 1999-04-13 15:41:10 +0000 | [diff] [blame] | 81 | {"sha", initsha}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 82 | {"strop", initstrop}, |
| 83 | {"struct", initstruct}, |
| 84 | {"time", inittime}, |
Guido van Rossum | bf57ed5 | 1996-08-22 00:43:42 +0000 | [diff] [blame] | 85 | #ifdef WITH_THREAD |
| 86 | {"thread", initthread}, |
| 87 | #endif |
Guido van Rossum | 2e146b3 | 1997-05-06 16:00:32 +0000 | [diff] [blame] | 88 | {"cStringIO", initcStringIO}, |
| 89 | {"cPickle", initcPickle}, |
Guido van Rossum | 36e18e3 | 1997-11-25 06:00:59 +0000 | [diff] [blame] | 90 | {"pcre", initpcre}, |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 91 | #ifdef WIN32 |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 92 | {"msvcrt", initmsvcrt}, |
| 93 | {"_locale", init_locale}, |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 94 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 95 | |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 96 | {"_codecs", init_codecs}, |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 97 | {"xreadlines", initxreadlines}, |
Tim Peters | 747d5b6 | 2001-02-02 00:07:07 +0000 | [diff] [blame] | 98 | {"_weakref", init_weakref}, |
Tim Peters | 1566a17 | 2001-10-12 22:08:39 +0000 | [diff] [blame] | 99 | {"_hotshot", init_hotshot}, |
Tim Peters | d1f5ccc | 2002-12-29 23:46:40 +0000 | [diff] [blame] | 100 | {"_random", init_random}, |
Raymond Hettinger | 96ef811 | 2003-02-01 00:10:11 +0000 | [diff] [blame] | 101 | {"itertools", inititertools}, |
Guido van Rossum | 76bd689 | 2000-03-11 00:13:14 +0000 | [diff] [blame] | 102 | |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 103 | {"xxsubtype", initxxsubtype}, |
Just van Rossum | 52e14d6 | 2002-12-30 22:08:05 +0000 | [diff] [blame] | 104 | {"zipimport", initzipimport}, |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 105 | |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 106 | /* XXX tim: what's the purpose of ADDMODULE MARKER? */ |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 107 | /* -- ADDMODULE MARKER 2 -- */ |
| 108 | |
| 109 | /* This module "lives in" with marshal.c */ |
| 110 | {"marshal", PyMarshal_Init}, |
| 111 | |
| 112 | /* This lives it with import.c */ |
| 113 | {"imp", initimp}, |
| 114 | |
| 115 | /* These entries are here for sys.builtin_module_names */ |
| 116 | {"__main__", NULL}, |
| 117 | {"__builtin__", NULL}, |
| 118 | {"sys", NULL}, |
Guido van Rossum | f981c8f | 2000-07-12 12:11:36 +0000 | [diff] [blame] | 119 | {"exceptions", NULL}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 120 | |
| 121 | /* Sentinel */ |
| 122 | {0, 0} |
| 123 | }; |