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); |
Jeremy Hylton | c5007aa | 2000-06-30 05:02:53 +0000 | [diff] [blame] | 15 | #ifdef WITH_CYCLE_GC |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 16 | extern void initgc(void); |
Jeremy Hylton | c5007aa | 2000-06-30 05:02:53 +0000 | [diff] [blame] | 17 | #endif |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 18 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 19 | extern void initimageop(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 20 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 21 | extern void initmath(void); |
| 22 | extern void initmd5(void); |
| 23 | extern void initnew(void); |
| 24 | extern void initnt(void); |
| 25 | extern void initoperator(void); |
| 26 | extern void initregex(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 27 | #ifndef MS_WIN64 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 28 | extern void initrgbimg(void); |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 29 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 30 | extern void initrotor(void); |
| 31 | extern void initsignal(void); |
| 32 | extern void initsha(void); |
| 33 | extern void initstrop(void); |
| 34 | extern void initstruct(void); |
| 35 | extern void inittime(void); |
| 36 | extern void initthread(void); |
| 37 | extern void initcStringIO(void); |
| 38 | extern void initcPickle(void); |
| 39 | extern void initpcre(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 40 | #ifdef WIN32 |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 41 | extern void initmsvcrt(void); |
| 42 | extern void init_locale(void); |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 43 | #endif |
Thomas Wouters | 7889010 | 2000-07-22 19:25:51 +0000 | [diff] [blame] | 44 | extern void init_codecs(void); |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 45 | extern void initxreadlines(void); |
Tim Peters | 747d5b6 | 2001-02-02 00:07:07 +0000 | [diff] [blame] | 46 | extern void init_weakref(void); |
Tim Peters | 1566a17 | 2001-10-12 22:08:39 +0000 | [diff] [blame] | 47 | extern void init_hotshot(void); |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 48 | extern void initxxsubtype(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 | #ifdef WITH_CYCLE_GC |
| 68 | {"gc", initgc}, |
| 69 | #endif |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 70 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 71 | {"imageop", initimageop}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 72 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 73 | {"math", initmath}, |
| 74 | {"md5", initmd5}, |
| 75 | {"new", initnew}, |
Guido van Rossum | 2e146b3 | 1997-05-06 16:00:32 +0000 | [diff] [blame] | 76 | {"nt", initnt}, /* Use the NT os functions, not posix */ |
Guido van Rossum | 950a126 | 1996-07-30 17:38:17 +0000 | [diff] [blame] | 77 | {"operator", initoperator}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 78 | {"regex", initregex}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 79 | #ifndef MS_WIN64 |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 80 | {"rgbimg", initrgbimg}, |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 81 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 82 | {"rotor", initrotor}, |
| 83 | {"signal", initsignal}, |
Guido van Rossum | be211a5 | 1999-04-13 15:41:10 +0000 | [diff] [blame] | 84 | {"sha", initsha}, |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 85 | {"strop", initstrop}, |
| 86 | {"struct", initstruct}, |
| 87 | {"time", inittime}, |
Guido van Rossum | bf57ed5 | 1996-08-22 00:43:42 +0000 | [diff] [blame] | 88 | #ifdef WITH_THREAD |
| 89 | {"thread", initthread}, |
| 90 | #endif |
Guido van Rossum | 2e146b3 | 1997-05-06 16:00:32 +0000 | [diff] [blame] | 91 | {"cStringIO", initcStringIO}, |
| 92 | {"cPickle", initcPickle}, |
Guido van Rossum | 36e18e3 | 1997-11-25 06:00:59 +0000 | [diff] [blame] | 93 | {"pcre", initpcre}, |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 94 | #ifdef WIN32 |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 95 | {"msvcrt", initmsvcrt}, |
| 96 | {"_locale", init_locale}, |
Guido van Rossum | 29c1ea5 | 1997-08-07 00:11:34 +0000 | [diff] [blame] | 97 | #endif |
Guido van Rossum | 87d5e70 | 1996-05-28 22:50:17 +0000 | [diff] [blame] | 98 | |
Guido van Rossum | 23ef82f | 2000-05-08 14:15:19 +0000 | [diff] [blame] | 99 | {"_codecs", init_codecs}, |
Tim Peters | 58c82f0 | 2001-01-09 23:26:39 +0000 | [diff] [blame] | 100 | {"xreadlines", initxreadlines}, |
Tim Peters | 747d5b6 | 2001-02-02 00:07:07 +0000 | [diff] [blame] | 101 | {"_weakref", init_weakref}, |
Tim Peters | 1566a17 | 2001-10-12 22:08:39 +0000 | [diff] [blame] | 102 | {"_hotshot", init_hotshot}, |
Guido van Rossum | 76bd689 | 2000-03-11 00:13:14 +0000 | [diff] [blame] | 103 | |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 104 | {"xxsubtype", initxxsubtype}, |
| 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 | }; |