home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / Python / Source / Modules / config.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-18  |  2.8 KB  |  124 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. /*******************************************************/
  17.  
  18.  
  19. #include "Python.h"
  20.  
  21. #if defined(AMITCP) || defined(INET225)
  22.  
  23. /* special 'safe' init functions - they check library availabilities */
  24.  
  25. static void initpwd_check(void)
  26. {
  27.     if(!checkusergrouplib()) return;
  28.     initpwd();
  29. }
  30.  
  31. static void initgrp_check(void)
  32. {
  33.     if(!checkusergrouplib()) return;
  34.     initgrp();
  35. }
  36.  
  37. static void initcrypt_check(void)
  38. {
  39.     if(!checkusergrouplib()) return;
  40.     initcrypt();    
  41. }
  42.  
  43. static void initsyslog_check(void)
  44. {
  45.     if(!checksocketlib()) return;
  46.     initsyslog();
  47. }
  48.  
  49. static void initsocket_check(void)
  50. {
  51.     if(!checksocketlib()) return;
  52.     initsocket();
  53. }
  54.  
  55. static void initselect_check(void)
  56. {
  57.     if(!checksocketlib()) return;
  58.     initselect();
  59. }
  60.  
  61. #endif /* AmiTCP or Inet225 */
  62.  
  63.  
  64. struct _inittab _PyImport_Inittab[] = {
  65.  
  66. /************ HERE YOU NEED TO INSTALL ALL DESIRED MODULES!!!! **************/
  67.  
  68.     {"amiga",initamiga},
  69.     {"ARexxll",initARexx},
  70.     {"Doslib", initDoslib },
  71. //    {"amiga_exec", initamiga_exec },
  72. //    {"simplegfx", initsimplegfx },  // XXX experimental
  73.  
  74.     {"array",initarray},
  75.     {"binascii",initbinascii}, 
  76.     {"cmath",initcmath},
  77.     {"math",initmath},
  78.     {"new",initnew},
  79.     {"errno",initerrno},
  80.     {"environment",initenvironment},
  81.     {"regex",initregex},
  82.     {"pcre",initpcre},
  83.     {"strop",initstrop},
  84.     {"struct",initstruct},
  85.     {"time",inittime},
  86. //    {"timing",inittiming},        // XXX obsolete
  87.     {"md5",initmd5}, 
  88.     {"soundex",initsoundex},
  89.     {"rotor",initrotor},
  90.     {"operator",initoperator},
  91.     {"cStringIO",initcStringIO},
  92.     {"cPickle",initcPickle},
  93.     {"sha",initsha},
  94. //    {"zlib",PyInit_zlib},
  95.  
  96. #if defined(AMITCP) || defined(INET225)
  97.     /* Use the lib-checking init functions defined above */
  98.     {"pwd",initpwd_check},
  99.     {"grp",initgrp_check},
  100.     {"crypt",initcrypt_check},
  101.     {"select",initselect_check},
  102.     {"socket",initsocket_check},
  103.     {"syslog",initsyslog_check},
  104. #endif
  105.  
  106. /*  {"signal",initsignal}, */
  107.  
  108. /****************************************************** I.J. 10/12/1996 *****/
  109.  
  110.     /* This module "lives in" with marshal.c */
  111.     {"marshal", PyMarshal_Init},
  112.  
  113.     /* This lives in with import.c */
  114.     {"imp", initimp},
  115.  
  116.     /* These entries are here for sys.builtin_module_names */
  117.     {"__main__", NULL},
  118.     {"__builtin__", NULL},
  119.     {"sys", NULL},
  120.  
  121.     /* Sentinel */
  122.     {0, 0}
  123. };
  124.