home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / Python2 / Python20_source / Modules / config.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-29  |  3.0 KB  |  130 lines

  1.  
  2. /* Module configuration */
  3.  
  4. /* This file contains the table of built-in modules.
  5.    See init_builtin() in import.c. */
  6.  
  7. /**** I.J. 11/11/1995 ***/
  8. /* On the Amiga, you'll have to edit this file by hand to set up the *
  9. /* modules configuration (sorry)                       */
  10. /* Updated  8-dec-96 for Python 1.4                    */
  11. /* Updated 12-jan-98 for Python 1.5                    */
  12. /* Updated 25-dec-98 for I-Net225                      */
  13. /* Updated 25-apr-99 for Python 1.5.2                  */
  14. /*                (added sha, removed timing)          */
  15. /* Updated 16-okt-99 for 'network free' version        */
  16. /* Updated 12-sep-00 for Python 1.6                    */
  17. /*******************************************************/
  18.  
  19.  
  20. #include "Python.h"
  21. #include "protos.h"
  22.  
  23. #if defined(AMITCP) || defined(INET225)
  24.  
  25. /* special 'safe' init functions - they check library availabilities */
  26.  
  27. static void initpwd_check(void)
  28. {
  29.     if(!checkusergrouplib()) return;
  30.     initpwd();
  31. }
  32.  
  33. static void initgrp_check(void)
  34. {
  35.     if(!checkusergrouplib()) return;
  36.     initgrp();
  37. }
  38.  
  39. static void initcrypt_check(void)
  40. {
  41.     if(!checkusergrouplib()) return;
  42.     initcrypt();    
  43. }
  44.  
  45. static void initsyslog_check(void)
  46. {
  47.     if(!checksocketlib()) return;
  48.     initsyslog();
  49. }
  50.  
  51. static void initsocket_check(void)
  52. {
  53.     if(!checksocketlib()) return;
  54.     init_socket();
  55. }
  56.  
  57. static void initselect_check(void)
  58. {
  59.     if(!checksocketlib()) return;
  60.     initselect();
  61. }
  62.  
  63. #endif /* AmiTCP or Inet225 */
  64.  
  65.  
  66. struct _inittab _PyImport_Inittab[] = {
  67.  
  68. /************ HERE YOU NEED TO INSTALL ALL DESIRED MODULES!!!! **************/
  69.  
  70.     {"amiga",initamiga},
  71.     {"ARexxll",initARexx},
  72.     {"Doslib", initDoslib },
  73. //    {"Execlib", initExeclib },        // XXX experimental
  74. //    {"simplegfx", initsimplegfx },  // XXX experimental
  75.  
  76.     {"array",initarray},
  77.     {"binascii",initbinascii}, 
  78.     {"cmath",initcmath},
  79.     {"math",initmath},
  80.     {"new",initnew},
  81.     {"errno",initerrno},
  82.     {"environment",initenvironment},
  83.     {"regex",initregex},
  84.     {"pcre",initpcre},
  85.     {"strop",initstrop},
  86.     {"struct",initstruct},
  87.     {"time",inittime},
  88. //    {"timing",inittiming},        // XXX obsolete
  89.     {"md5",initmd5}, 
  90. //    {"soundex",initsoundex},
  91.     {"rotor",initrotor},
  92.     {"operator",initoperator},
  93.     {"cStringIO",initcStringIO},
  94.     {"cPickle",initcPickle},
  95.     {"sha",initsha},
  96. //    {"zlib",initzlib},
  97.     {"_codecs", init_codecs},
  98.     {"_sre", init_sre},
  99.     {"unicodedata", initunicodedata},
  100.     {"pyexpat", initpyexpat},
  101.  
  102. #if defined(AMITCP) || defined(INET225)
  103.     /* Use the lib-checking init functions defined above */
  104.     {"pwd",initpwd_check},
  105.     {"grp",initgrp_check},
  106.     {"crypt",initcrypt_check},
  107.     {"select",initselect_check},
  108.     {"_socket",initsocket_check},
  109.     {"syslog",initsyslog_check},
  110. #endif
  111.  
  112. /*  {"signal",initsignal}, */
  113.  
  114. /****************************************************** I.J. 10/12/1996 *****/
  115.  
  116.     /* This module "lives in" with marshal.c */
  117.     {"marshal", PyMarshal_Init},
  118.  
  119.     /* This lives in with import.c */
  120.     {"imp", initimp},
  121.  
  122.     /* These entries are here for sys.builtin_module_names */
  123.     {"__main__", NULL},
  124.     {"__builtin__", NULL},
  125.     {"sys", NULL},
  126.  
  127.     /* Sentinel */
  128.     {0, 0}
  129. };
  130.