Home | History | Annotate | Download | only in Modules
      1 /** @file
      2     Python Module configuration.
      3 
      4     Copyright (c) 2011-2012, Intel Corporation. All rights reserved.<BR>
      5     This program and the accompanying materials are licensed and made available under
      6     the terms and conditions of the BSD License that accompanies this distribution.
      7     The full text of the license may be found at
      8     http://opensource.org/licenses/bsd-license.
      9 
     10     THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11     WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     12 **/
     13 
     14 /* This file contains the table of built-in modules.
     15    See init_builtin() in import.c. */
     16 
     17 #include "Python.h"
     18 
     19 extern void initarray(void);
     20 extern void init_ast(void);
     21 extern void initbinascii(void);
     22 extern void init_bisect(void);
     23 extern void initcmath(void);
     24 extern void init_codecs(void);
     25 extern void init_collections(void);
     26 extern void initcPickle(void);
     27 extern void initcStringIO(void);
     28 extern void init_csv(void);
     29 extern void init_ctypes(void);
     30 extern void initdatetime(void);
     31 extern void initedk2(void);
     32 extern void initerrno(void);
     33 extern void init_functools(void);
     34 extern void initfuture_builtins(void);
     35 extern void initgc(void);
     36 extern void init_heapq(void);
     37 extern void init_hotshot(void);
     38 extern void initimp(void);
     39 extern void init_io(void);
     40 extern void inititertools(void);
     41 extern void init_json(void);
     42 extern void init_lsprof(void);
     43 extern void initmath(void);
     44 extern void init_md5(void);
     45 extern void initmmap(void);
     46 extern void initoperator(void);
     47 extern void initparser(void);
     48 extern void initpyexpat(void);
     49 extern void init_random(void);
     50 extern void initselect(void);
     51 extern void init_sha(void);
     52 extern void init_sha256(void);
     53 extern void init_sha512(void);
     54 extern void initsignal(void);
     55 extern void init_socket(void);
     56 extern void init_sre(void);
     57 extern void initstrop(void);
     58 extern void init_struct(void);
     59 extern void init_subprocess(void);
     60 extern void init_symtable(void);
     61 extern void initthread(void);
     62 extern void inittime(void);
     63 extern void initunicodedata(void);
     64 extern void init_weakref(void);
     65 extern void init_winreg(void);
     66 extern void initxxsubtype(void);
     67 extern void initzipimport(void);
     68 extern void initzlib(void);
     69 
     70 extern void PyMarshal_Init(void);
     71 extern void _PyWarnings_Init(void);
     72 
     73 extern void init_multibytecodec(void);
     74 extern void init_codecs_cn(void);
     75 extern void init_codecs_hk(void);
     76 extern void init_codecs_iso2022(void);
     77 extern void init_codecs_jp(void);
     78 extern void init_codecs_kr(void);
     79 extern void init_codecs_tw(void);
     80 
     81 struct _inittab _PyImport_Inittab[] = {
     82 
     83     //{"_ast", init_ast},
     84     //{"_bisect", init_bisect},               /* A fast version of bisect.py */
     85     //{"_csv", init_csv},
     86     //{"_heapq", init_heapq},                 /* A fast version of heapq.py */
     87     //{"_io", init_io},
     88     //{"_json", init_json},
     89     //{"_md5", init_md5},
     90     //{"_sha", init_sha},
     91     //{"_sha256", init_sha256},
     92     //{"_sha512", init_sha512},
     93     //{"_socket", init_socket},
     94     //{"_symtable", init_symtable},
     95 
     96     //{"array", initarray},
     97     //{"cmath", initcmath},
     98     //{"cPickle", initcPickle},
     99     //{"datetime", initdatetime},
    100     //{"future_builtins", initfuture_builtins},
    101     //{"parser", initparser},
    102     //{"pyexpat", initpyexpat},
    103     //{"select", initselect},
    104     //{"signal", initsignal},
    105     //{"strop", initstrop},                   /* redefines some string operations that are 100-1000 times faster */
    106     //{"unicodedata", initunicodedata},
    107     //{"xxsubtype", initxxsubtype},
    108     //{"zipimport", initzipimport},
    109     //{"zlib", initzlib},
    110 
    111     /* CJK codecs */
    112     //{"_multibytecodec", init_multibytecodec},
    113     //{"_codecs_cn", init_codecs_cn},
    114     //{"_codecs_hk", init_codecs_hk},
    115     //{"_codecs_iso2022", init_codecs_iso2022},
    116     //{"_codecs_jp", init_codecs_jp},
    117     //{"_codecs_kr", init_codecs_kr},
    118     //{"_codecs_tw", init_codecs_tw},
    119 
    120 #ifdef WITH_THREAD
    121     {"thread", initthread},
    122 #endif
    123 
    124     /* These modules are required for the full built-in help() facility provided by pydoc. */
    125     {"_codecs", init_codecs},
    126     {"_collections", init_collections},
    127     {"_functools", init_functools},
    128     {"_random", init_random},
    129     {"_sre", init_sre},
    130     {"_struct", init_struct},                   /* Required by the logging package. */
    131     {"_weakref", init_weakref},
    132     {"binascii", initbinascii},
    133     {"cStringIO", initcStringIO},               /* Required by several modules, such as logging. */
    134     {"gc", initgc},
    135     {"itertools", inititertools},
    136     {"math", initmath},
    137     {"operator", initoperator},
    138     {"time", inittime},
    139 
    140     /* These four modules should always be built in. */
    141     {"edk2", initedk2},
    142     {"errno", initerrno},
    143     {"imp", initimp},                   /* We get this for free from Python/import.c  */
    144     {"marshal", PyMarshal_Init},        /* We get this for free from Python/marshal.c */
    145 
    146     /* These entries are here for sys.builtin_module_names */
    147     {"__main__", NULL},
    148     {"__builtin__", NULL},
    149     {"sys", NULL},
    150     {"exceptions", NULL},
    151     {"_warnings", _PyWarnings_Init},
    152 
    153     /* Sentinel */
    154     {0, 0}
    155 };
    156