Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 1 | /*********************************************************** |
Guido van Rossum | e35399e | 1993-01-10 18:33:56 +0000 | [diff] [blame] | 2 | Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, |
| 3 | Amsterdam, The Netherlands. |
Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 4 | |
| 5 | All Rights Reserved |
| 6 | |
| 7 | Permission to use, copy, modify, and distribute this software and its |
| 8 | documentation for any purpose and without fee is hereby granted, |
| 9 | provided that the above copyright notice appear in all copies and that |
| 10 | both that copyright notice and this permission notice appear in |
| 11 | supporting documentation, and that the names of Stichting Mathematisch |
| 12 | Centrum or CWI not be used in advertising or publicity pertaining to |
| 13 | distribution of the software without specific, written prior permission. |
| 14 | |
| 15 | STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO |
| 16 | THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 17 | FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE |
| 18 | FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 19 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 20 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
| 21 | OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 22 | |
| 23 | ******************************************************************/ |
| 24 | |
Guido van Rossum | 28a83ab | 1991-01-18 15:32:01 +0000 | [diff] [blame] | 25 | /* Configurable Python configuration file */ |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 26 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 27 | /* These modules are normally always included, but *may* be taken out */ |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 28 | #define USE_MARSHAL 1 /* This is linked anyway */ |
Guido van Rossum | aee0879 | 1992-09-08 09:05:33 +0000 | [diff] [blame] | 29 | #define USE_MATH 1 |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 30 | #define USE_STRUCT 1 |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 31 | #define USE_TIME 1 |
| 32 | |
| 33 | #ifdef macintosh |
| 34 | #define USE_AUDIOOP 1 |
| 35 | #define USE_IMAGEOP 1 |
| 36 | #define USE_MAC 1 |
| 37 | #define USE_REGEX 1 |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 38 | #define USE_STDWIN 1 /* You may turn this off */ |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 39 | #define USE_STROP |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 40 | #endif |
| 41 | |
| 42 | #ifdef unix |
| 43 | #define USE_GRP 1 /* Use together with pwd */ |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 44 | #define USE_POSIX 1 |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 45 | #define USE_PWD 1 /* Use together with grp */ |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 46 | #define USE_SELECT 1 |
| 47 | #define USE_SOCKET 1 |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 48 | #endif |
| 49 | |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 50 | #ifdef MSDOS |
| 51 | #define USE_POSIX 1 /* Subset defined in posixmodule.c */ |
| 52 | #define USE_REGEX 1 |
| 53 | #define USE_STROP 1 |
| 54 | #define USE_PC 1 |
| 55 | #endif |
| 56 | |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 57 | #include <stdio.h> |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 58 | |
Guido van Rossum | c888bf7 | 1992-06-03 17:05:13 +0000 | [diff] [blame] | 59 | #include "PROTO.h" |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 60 | #include "mymalloc.h" |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 61 | #include "osdefs.h" |
Guido van Rossum | c888bf7 | 1992-06-03 17:05:13 +0000 | [diff] [blame] | 62 | |
Guido van Rossum | 9b4e1b3 | 1991-12-30 01:43:49 +0000 | [diff] [blame] | 63 | #include "patchlevel.h" |
| 64 | |
Guido van Rossum | e906606 | 1993-07-29 13:14:32 +0000 | [diff] [blame] | 65 | #define VERSION "0.9.%d (%s)" |
Guido van Rossum | aa01141 | 1991-12-16 13:05:20 +0000 | [diff] [blame] | 66 | |
| 67 | #ifdef __DATE__ |
| 68 | #define DATE __DATE__ |
| 69 | #else |
Guido van Rossum | e906606 | 1993-07-29 13:14:32 +0000 | [diff] [blame] | 70 | #define DATE ">= 29 Jul 1993" |
Guido van Rossum | aa01141 | 1991-12-16 13:05:20 +0000 | [diff] [blame] | 71 | #endif |
Guido van Rossum | 9f462af | 1991-12-10 13:54:12 +0000 | [diff] [blame] | 72 | |
Guido van Rossum | 28a83ab | 1991-01-18 15:32:01 +0000 | [diff] [blame] | 73 | #ifdef USE_STDWIN |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 74 | #ifdef macintosh |
Guido van Rossum | e906606 | 1993-07-29 13:14:32 +0000 | [diff] [blame] | 75 | #include ":::stdwin:H:stdwin.h" |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 76 | #else /* !macintosh */ |
| 77 | #include "stdwin.h" |
| 78 | #endif /* !macintosh */ |
| 79 | #endif /* USE_STDWIN */ |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 80 | |
Guido van Rossum | aa01141 | 1991-12-16 13:05:20 +0000 | [diff] [blame] | 81 | char version[80]; |
| 82 | |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 83 | char *argv0; /* For dynamic loading in import.c */ |
Guido van Rossum | 450ed49 | 1992-01-19 16:27:42 +0000 | [diff] [blame] | 84 | |
Guido van Rossum | f56e3db | 1993-04-01 20:59:32 +0000 | [diff] [blame] | 85 | extern char verbose; |
| 86 | |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 87 | /*ARGSUSED*/ |
| 88 | void |
| 89 | initargs(p_argc, p_argv) |
| 90 | int *p_argc; |
| 91 | char ***p_argv; |
| 92 | { |
Guido van Rossum | 9b4e1b3 | 1991-12-30 01:43:49 +0000 | [diff] [blame] | 93 | sprintf(version, VERSION, PATCHLEVEL, DATE); |
Guido van Rossum | aa01141 | 1991-12-16 13:05:20 +0000 | [diff] [blame] | 94 | |
Guido van Rossum | 450ed49 | 1992-01-19 16:27:42 +0000 | [diff] [blame] | 95 | argv0 = **p_argv; |
| 96 | |
Guido van Rossum | 28a83ab | 1991-01-18 15:32:01 +0000 | [diff] [blame] | 97 | #ifdef USE_STDWIN |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 98 | #ifdef THINK_C_3_0 |
| 99 | wsetstdio(1); |
Guido van Rossum | 28a83ab | 1991-01-18 15:32:01 +0000 | [diff] [blame] | 100 | #endif |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 101 | wargs(p_argc, p_argv); |
| 102 | #endif /* USE_STDWIN */ |
Guido van Rossum | f56e3db | 1993-04-01 20:59:32 +0000 | [diff] [blame] | 103 | #ifdef USE_FROZEN |
| 104 | if (verbose) |
| 105 | #else |
| 106 | if (verbose || *p_argc < 2 && isatty(0) && isatty(1)) |
| 107 | #endif |
Guido van Rossum | 9f462af | 1991-12-10 13:54:12 +0000 | [diff] [blame] | 108 | { |
| 109 | printf("Python %s.\n", version); |
Guido van Rossum | aa01141 | 1991-12-16 13:05:20 +0000 | [diff] [blame] | 110 | printf( |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 111 | "Copyright 1990, 1991, 1992, 1993 Stichting Mathematisch Centrum, Amsterdam\n"); |
Guido van Rossum | 9f462af | 1991-12-10 13:54:12 +0000 | [diff] [blame] | 112 | } |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | void |
| 116 | initcalls() |
| 117 | { |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | void |
| 121 | donecalls() |
| 122 | { |
Guido van Rossum | 28a83ab | 1991-01-18 15:32:01 +0000 | [diff] [blame] | 123 | #ifdef USE_STDWIN |
Guido van Rossum | 5b02dbc | 1991-06-07 13:55:41 +0000 | [diff] [blame] | 124 | wdone(); |
Guido van Rossum | 28a83ab | 1991-01-18 15:32:01 +0000 | [diff] [blame] | 125 | #endif |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 126 | #ifdef USE_AUDIO |
| 127 | asa_done(); |
| 128 | #endif |
| 129 | } |
| 130 | |
| 131 | #ifndef PYTHONPATH |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 132 | |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 133 | #ifdef macintosh |
| 134 | /* On the Mac, the search path is a space-separated list of directories */ |
| 135 | #define PYTHONPATH ": :lib :demo" |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 136 | #endif /* macintosh */ |
| 137 | |
| 138 | #ifdef unix |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 139 | #define PYTHONPATH ".:/usr/local/lib/python" |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 140 | #endif /* unix */ |
| 141 | |
| 142 | #ifdef MSDOS |
| 143 | /* In MS-DOS, the delimiter is a semicolon */ |
Guido van Rossum | e22e644 | 1993-07-09 10:51:31 +0000 | [diff] [blame] | 144 | #define PYTHONPATH ".;..\\lib;\\python\\lib" |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 145 | #endif /* MSDOS */ |
| 146 | |
| 147 | #ifndef PYTHONPATH |
| 148 | ERROR; ERROR; On what kind of system are you?; |
| 149 | #endif |
| 150 | |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 151 | #endif /* !PYTHONPATH */ |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 152 | |
| 153 | extern char *getenv(); |
| 154 | |
| 155 | char * |
| 156 | getpythonpath() |
| 157 | { |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 158 | #ifdef macintosh |
| 159 | return PYTHONPATH; |
| 160 | #else /* !macintosh */ |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 161 | char *path = getenv("PYTHONPATH"); |
Guido van Rossum | c888bf7 | 1992-06-03 17:05:13 +0000 | [diff] [blame] | 162 | char *defpath = PYTHONPATH; |
| 163 | char *buf; |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 164 | char *p; |
Guido van Rossum | c888bf7 | 1992-06-03 17:05:13 +0000 | [diff] [blame] | 165 | int n; |
| 166 | |
| 167 | if (path == 0 || *path == '\0') |
| 168 | return defpath; |
| 169 | n = strlen(path) + strlen(defpath) + 2; |
| 170 | buf = malloc(n); |
| 171 | if (buf == NULL) |
| 172 | return path; /* XXX too bad -- but not likely */ |
| 173 | strcpy(buf, path); |
Guido van Rossum | 34679b7 | 1993-01-26 13:33:44 +0000 | [diff] [blame] | 174 | p = buf + strlen(buf); |
| 175 | *p++ = DELIM; |
| 176 | strcpy(p, defpath); |
Guido van Rossum | c888bf7 | 1992-06-03 17:05:13 +0000 | [diff] [blame] | 177 | return buf; |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 178 | #endif /* !macintosh */ |
Guido van Rossum | aec7855 | 1990-12-20 23:03:58 +0000 | [diff] [blame] | 179 | } |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 180 | |
| 181 | |
| 182 | /* Table of built-in modules. |
| 183 | These are initialized when first imported. */ |
| 184 | |
| 185 | /* Standard modules */ |
Guido van Rossum | 6f7b959 | 1991-06-04 19:47:46 +0000 | [diff] [blame] | 186 | |
Guido van Rossum | 188f832 | 1991-09-10 14:55:08 +0000 | [diff] [blame] | 187 | #ifdef USE_AL |
| 188 | extern void inital(); |
| 189 | #endif |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 190 | #ifdef USE_AMOEBA |
| 191 | extern void initamoeba(); |
| 192 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 193 | #ifdef USE_AUDIO |
| 194 | extern void initaudio(); |
| 195 | #endif |
Guido van Rossum | c89705d | 1992-11-26 08:54:07 +0000 | [diff] [blame] | 196 | #ifdef USE_AUDIOOP |
| 197 | extern void initaudioop(); |
| 198 | #endif |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 199 | #ifdef USE_CD |
| 200 | extern void initcd(); |
| 201 | #endif |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 202 | #ifdef USE_CL |
| 203 | extern void initcl(); |
| 204 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 205 | #ifdef USE_DBM |
| 206 | extern void initdbm(); |
| 207 | #endif |
| 208 | #ifdef USE_FCNTL |
| 209 | extern void initfcntl(); |
| 210 | #endif |
Guido van Rossum | 3fecef7 | 1991-08-16 08:58:56 +0000 | [diff] [blame] | 211 | #ifdef USE_FL |
| 212 | extern void initfl(); |
| 213 | #endif |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 214 | #ifdef USE_FM |
| 215 | extern void initfm(); |
| 216 | #endif |
| 217 | #ifdef USE_GL |
| 218 | extern void initgl(); |
| 219 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 220 | #ifdef USE_GRP |
| 221 | extern void initgrp(); |
| 222 | #endif |
| 223 | #ifdef USE_IMGFILE |
| 224 | extern void initimgfile(); |
| 225 | #endif |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 226 | #ifdef USE_JPEG |
| 227 | extern void initjpeg(); |
| 228 | #endif |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 229 | #ifdef USE_MAC |
| 230 | extern void initmac(); |
| 231 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 232 | #ifdef USE_MARSHAL |
| 233 | extern void initmarshal(); |
| 234 | #endif |
| 235 | #ifdef USE_MATH |
| 236 | extern void initmath(); |
| 237 | #endif |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 238 | #ifdef USE_NIS |
| 239 | extern void initnis(); |
Guido van Rossum | 2abc7a6 | 1991-04-03 19:01:18 +0000 | [diff] [blame] | 240 | #endif |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 241 | #ifdef USE_PANEL |
| 242 | extern void initpanel(); |
| 243 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 244 | #ifdef USE_POSIX |
| 245 | extern void initposix(); |
| 246 | #endif |
| 247 | #ifdef USE_PWD |
| 248 | extern void initpwd(); |
| 249 | #endif |
Guido van Rossum | 38fbf52 | 1992-08-12 15:28:52 +0000 | [diff] [blame] | 250 | #ifdef USE_REGEX |
| 251 | extern void initregex(); |
| 252 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 253 | #ifdef USE_ROTOR |
| 254 | extern void initrotor(); |
| 255 | #endif |
| 256 | #ifdef USE_SELECT |
| 257 | extern void initselect(); |
| 258 | #endif |
| 259 | #ifdef USE_SGI |
| 260 | extern void initsgi(); |
| 261 | #endif |
| 262 | #ifdef USE_SOCKET |
| 263 | extern void initsocket(); |
| 264 | #endif |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 265 | #ifdef USE_STDWIN |
Guido van Rossum | 5b02dbc | 1991-06-07 13:55:41 +0000 | [diff] [blame] | 266 | extern void initstdwin(); |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 267 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 268 | #ifdef USE_STROP |
| 269 | extern void initstrop(); |
| 270 | #endif |
| 271 | #ifdef USE_STRUCT |
| 272 | extern void initstruct(); |
| 273 | #endif |
| 274 | #ifdef USE_SUNAUDIODEV |
| 275 | extern void initsunaudiodev(); |
| 276 | #endif |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 277 | #ifdef USE_THREAD |
| 278 | extern void initthread(); |
| 279 | #endif |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 280 | #ifdef USE_SV |
| 281 | extern void initsv(); |
Guido van Rossum | 38fbf52 | 1992-08-12 15:28:52 +0000 | [diff] [blame] | 282 | #endif |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 283 | #ifdef USE_TIME |
| 284 | extern void inittime(); |
| 285 | #endif |
Guido van Rossum | 0317a47 | 1992-10-26 13:40:15 +0000 | [diff] [blame] | 286 | #ifdef USE_IMAGEOP |
| 287 | extern void initimageop(); |
| 288 | #endif |
Guido van Rossum | 8ed2941 | 1992-12-08 16:10:18 +0000 | [diff] [blame] | 289 | #ifdef USE_MPZ |
| 290 | extern void initmpz(); |
| 291 | #endif |
| 292 | #ifdef USE_MD5 |
| 293 | extern void initmd5(); |
| 294 | #endif |
Guido van Rossum | 778983b | 1993-02-19 15:55:02 +0000 | [diff] [blame] | 295 | #ifdef USE_ARRAY |
| 296 | extern void initarray(); |
| 297 | #endif |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 298 | #ifdef USE_XT |
| 299 | extern void initXt(); |
| 300 | #endif |
| 301 | #ifdef USE_XAW |
| 302 | extern void initXaw(); |
| 303 | #endif |
| 304 | #ifdef USE_XM |
| 305 | extern void initXm(); |
| 306 | #endif |
| 307 | #ifdef USE_GLX |
| 308 | extern void initGlx(); |
| 309 | #endif |
| 310 | #ifdef USE_HTML |
| 311 | extern void initHTML(); |
| 312 | #endif |
Guido van Rossum | 3a40ae4 | 1992-09-25 21:54:05 +0000 | [diff] [blame] | 313 | /* -- ADDMODULE MARKER 1 -- */ |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 314 | |
| 315 | struct { |
| 316 | char *name; |
| 317 | void (*initfunc)(); |
| 318 | } inittab[] = { |
| 319 | |
Guido van Rossum | 188f832 | 1991-09-10 14:55:08 +0000 | [diff] [blame] | 320 | #ifdef USE_AL |
| 321 | {"al", inital}, |
| 322 | #endif |
| 323 | |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 324 | #ifdef USE_AMOEBA |
| 325 | {"amoeba", initamoeba}, |
| 326 | #endif |
| 327 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 328 | #ifdef USE_AUDIO |
| 329 | {"audio", initaudio}, |
| 330 | #endif |
| 331 | |
Guido van Rossum | c89705d | 1992-11-26 08:54:07 +0000 | [diff] [blame] | 332 | #ifdef USE_AUDIOOP |
| 333 | {"audioop", initaudioop}, |
| 334 | #endif |
| 335 | |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 336 | #ifdef USE_CD |
| 337 | {"cd", initcd}, |
| 338 | #endif |
| 339 | |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 340 | #ifdef USE_CL |
| 341 | {"cl", initcl}, |
| 342 | #endif |
| 343 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 344 | #ifdef USE_DBM |
| 345 | {"dbm", initdbm}, |
| 346 | #endif |
| 347 | |
| 348 | #ifdef USE_FCNTL |
| 349 | {"fcntl", initfcntl}, |
| 350 | #endif |
| 351 | |
Guido van Rossum | 3fecef7 | 1991-08-16 08:58:56 +0000 | [diff] [blame] | 352 | #ifdef USE_FL |
| 353 | {"fl", initfl}, |
| 354 | #endif |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 355 | |
| 356 | #ifdef USE_FM |
| 357 | {"fm", initfm}, |
Guido van Rossum | 2abc7a6 | 1991-04-03 19:01:18 +0000 | [diff] [blame] | 358 | #endif |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 359 | |
| 360 | #ifdef USE_GL |
| 361 | {"gl", initgl}, |
| 362 | #endif |
| 363 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 364 | #ifdef USE_GRP |
| 365 | {"grp", initgrp}, |
| 366 | #endif |
| 367 | |
| 368 | #ifdef USE_IMGFILE |
| 369 | {"imgfile", initimgfile}, |
| 370 | #endif |
| 371 | |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 372 | #ifdef USE_JPEG |
| 373 | {"jpeg", initjpeg}, |
| 374 | #endif |
| 375 | |
Guido van Rossum | 0b0db8e | 1993-01-21 16:07:51 +0000 | [diff] [blame] | 376 | #ifdef USE_MAC |
| 377 | {"mac", initmac}, |
| 378 | #endif |
| 379 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 380 | #ifdef USE_MARSHAL |
| 381 | {"marshal", initmarshal}, |
| 382 | #endif |
| 383 | |
| 384 | #ifdef USE_MATH |
| 385 | {"math", initmath}, |
| 386 | #endif |
| 387 | |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 388 | #ifdef USE_NIS |
| 389 | {"nis", initnis}, |
| 390 | #endif |
| 391 | |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 392 | #ifdef USE_PANEL |
| 393 | {"pnl", initpanel}, |
| 394 | #endif |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 395 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 396 | #ifdef USE_POSIX |
| 397 | {"posix", initposix}, |
| 398 | #endif |
| 399 | |
| 400 | #ifdef USE_PWD |
| 401 | {"pwd", initpwd}, |
| 402 | #endif |
| 403 | |
Guido van Rossum | 38fbf52 | 1992-08-12 15:28:52 +0000 | [diff] [blame] | 404 | #ifdef USE_REGEX |
| 405 | {"regex", initregex}, |
| 406 | #endif |
| 407 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 408 | #ifdef USE_ROTOR |
| 409 | {"rotor", initrotor}, |
| 410 | #endif |
| 411 | |
| 412 | #ifdef USE_SELECT |
| 413 | {"select", initselect}, |
| 414 | #endif |
| 415 | |
| 416 | #ifdef USE_SGI |
| 417 | {"sgi", initsgi}, |
| 418 | #endif |
| 419 | |
| 420 | #ifdef USE_SOCKET |
| 421 | {"socket", initsocket}, |
| 422 | #endif |
| 423 | |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 424 | #ifdef USE_STDWIN |
Guido van Rossum | 5b02dbc | 1991-06-07 13:55:41 +0000 | [diff] [blame] | 425 | {"stdwin", initstdwin}, |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 426 | #endif |
| 427 | |
Guido van Rossum | aee0879 | 1992-09-08 09:05:33 +0000 | [diff] [blame] | 428 | #ifdef USE_STROP |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 429 | {"strop", initstrop}, |
| 430 | #endif |
| 431 | |
| 432 | #ifdef USE_STRUCT |
| 433 | {"struct", initstruct}, |
| 434 | #endif |
| 435 | |
| 436 | #ifdef USE_SUNAUDIODEV |
| 437 | {"sunaudiodev", initsunaudiodev}, |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 438 | #endif |
| 439 | |
Guido van Rossum | b001f7a | 1992-08-19 16:44:41 +0000 | [diff] [blame] | 440 | #ifdef USE_SV |
| 441 | {"sv", initsv}, |
Guido van Rossum | 38fbf52 | 1992-08-12 15:28:52 +0000 | [diff] [blame] | 442 | #endif |
| 443 | |
Guido van Rossum | 97f0277 | 1992-09-03 20:49:55 +0000 | [diff] [blame] | 444 | #ifdef USE_THREAD |
| 445 | {"thread", initthread}, |
| 446 | #endif |
| 447 | |
| 448 | #ifdef USE_TIME |
| 449 | {"time", inittime}, |
| 450 | #endif |
| 451 | |
Guido van Rossum | 0317a47 | 1992-10-26 13:40:15 +0000 | [diff] [blame] | 452 | #ifdef USE_IMAGEOP |
| 453 | {"imageop", initimageop}, |
| 454 | #endif |
| 455 | |
Guido van Rossum | 8ed2941 | 1992-12-08 16:10:18 +0000 | [diff] [blame] | 456 | #ifdef USE_MPZ |
| 457 | {"mpz", initmpz}, |
| 458 | #endif |
| 459 | |
| 460 | #ifdef USE_MD5 |
| 461 | {"md5", initmd5}, |
| 462 | #endif |
| 463 | |
Guido van Rossum | 778983b | 1993-02-19 15:55:02 +0000 | [diff] [blame] | 464 | #ifdef USE_ARRAY |
| 465 | {"array", initarray}, |
| 466 | #endif |
| 467 | |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 468 | #ifdef USE_XT |
| 469 | {"Xt", initXt}, |
| 470 | #endif |
| 471 | |
| 472 | #ifdef USE_XAW |
| 473 | {"Xaw", initXaw}, |
| 474 | #endif |
| 475 | |
| 476 | #ifdef USE_XM |
| 477 | {"Xm", initXm}, |
| 478 | #endif |
| 479 | |
| 480 | #ifdef USE_GLX |
| 481 | {"Glx", initGlx}, |
| 482 | #endif |
| 483 | |
| 484 | #ifdef USE_HTML |
| 485 | {"HTML", initHTML}, |
| 486 | #endif |
| 487 | |
Guido van Rossum | 3a40ae4 | 1992-09-25 21:54:05 +0000 | [diff] [blame] | 488 | /* -- ADDMODULE MARKER 2 -- */ |
| 489 | |
Guido van Rossum | 59e53a5 | 1991-02-19 12:22:24 +0000 | [diff] [blame] | 490 | {0, 0} /* Sentinel */ |
| 491 | }; |
Guido van Rossum | f56e3db | 1993-04-01 20:59:32 +0000 | [diff] [blame] | 492 | |
| 493 | #ifdef USE_FROZEN |
| 494 | #include "frozen.c" |
| 495 | #else |
| 496 | struct frozen { |
| 497 | char *name; |
| 498 | char *code; |
| 499 | int size; |
| 500 | } frozen_modules[] = { |
| 501 | {0, 0, 0} |
| 502 | }; |
| 503 | #endif |