diff options
Diffstat (limited to 'Mac/Modules')
-rw-r--r-- | Mac/Modules/config.c | 67 | ||||
-rw-r--r-- | Mac/Modules/macmodule.c | 32 |
2 files changed, 65 insertions, 34 deletions
diff --git a/Mac/Modules/config.c b/Mac/Modules/config.c index a018551..abb5296 100644 --- a/Mac/Modules/config.c +++ b/Mac/Modules/config.c @@ -1,5 +1,6 @@ -/*********************************************************** -Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, +/* Generated automatically from ../../Modules/config.c.in by makesetup. */ +/* -*- C -*- *********************************************** +Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved @@ -34,6 +35,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "myproto.h" #include "mymalloc.h" #include "osdefs.h" +#include "intrcheck.h" #ifndef NO_MAIN @@ -52,17 +54,9 @@ main(argc, argv) char **argv; { #ifdef macintosh - -#ifndef MPW /* XXX RJW undefined in MPW */ - wargs(&argc, &argv); -#endif - -#ifndef MPW_3 /* XXX RJW doesn't seem to work with MPW C 3.0 */ - extern int std_open_hook(); - set_open_hook (std_open_hook); + /* Macs always support stdwin */ +// wargs(&argc, &argv); #endif -#endif - argv0 = argv[0]; realmain(argc, argv); } @@ -76,6 +70,40 @@ getprogramname() #endif +/* Python version information */ + +#include "patchlevel.h" + +/* Return the version string. This is constructed from the official + version number (from patchlevel.h), and the current date (if known + to the compiler, else a manually inserted date). */ + +#define VERSION "%s (%s)" + +#ifdef __DATE__ +#define DATE __DATE__ +#else +#define DATE "Aug 17 1994" +#endif + +char * +getversion() +{ + static char version[80]; + sprintf(version, VERSION, PATCHLEVEL, DATE); + return version; +} + + +/* Return the copyright string. This is updated manually. */ + +char * +getcopyright() +{ + return "Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam"; +} + + /* Return the initial python search path. This is called once from initsys() to initialize sys.path. The environment variable PYTHONPATH is fetched and the default path @@ -85,14 +113,14 @@ getprogramname() #ifndef PYTHONPATH #ifdef macintosh -#define PYTHONPATH ": :Lib :Lib:stdwin :Demo" +#define PYTHONPATH ": :Lib :Lib:stdwin :Lib:test :Lib:mac" #endif /* macintosh */ #endif /* !PYTHONPATH */ #ifndef PYTHONPATH -#ifdef MSDOS +#if defined(MSDOS) || defined(NT) #define PYTHONPATH ".;..\\lib;\\python\\lib" -#endif /* MSDOS */ +#endif /* MSDOS || NT */ #endif /* !PYTHONPATH */ #ifndef PYTHONPATH @@ -146,6 +174,7 @@ extern void initfcntl(); extern void initnis(); extern void initpwd(); extern void initgrp(); +extern void initcrypt(); extern void initselect(); extern void initsocket(); extern void initaudioop(); @@ -166,6 +195,10 @@ extern void initsv(); extern void initfl(); extern void initthread(); extern void inittiming(); +extern void initsignal(); +extern void initnew(); +extern void initdl(); +extern void initsyslog(); /* -- ADDMODULE MARKER 1 -- */ @@ -187,9 +220,11 @@ struct { {"audioop", initaudioop}, {"imageop", initimageop}, {"rgbimg", initrgbimg}, - {"stdwin", initstdwin}, +// {"stdwin", initstdwin}, {"md5", initmd5}, {"rotor", initrotor}, +// {"signal", initsignal}, + {"new", initnew}, /* -- ADDMODULE MARKER 2 -- */ diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c index f684dd2..b495dfa 100644 --- a/Mac/Modules/macmodule.c +++ b/Mac/Modules/macmodule.c @@ -36,9 +36,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <fcntl.h> -#include ":::unixemu:macdefs.h" -#include ":::unixemu:dir.h" -#include ":::unixemu:stat.h" +#include "macdefs.h" +#include "dirent.h" +#include "stat.h" #ifndef MAXPATHLEN #define MAXPATHLEN 1024 @@ -46,14 +46,13 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* Prototypes for Unix simulation on Mac */ -int access PROTO((const char *path, int mode)); int chdir PROTO((const char *path)); char *getbootvol PROTO((void)); char *getwd PROTO((char *)); int mkdir PROTO((const char *path, int mode)); DIR * opendir PROTO((char *)); void closedir PROTO((DIR *)); -struct direct * readdir PROTO((DIR *)); +struct dirent * readdir PROTO((DIR *)); int rmdir PROTO((const char *path)); int stat PROTO((const char *path, struct stat *buf)); int sync PROTO((void)); @@ -129,14 +128,6 @@ mac_strint(args, func) } static object * -mac_access(self, args) - object *self; - object *args; -{ - return mac_strint(args, access); -} - -static object * mac_chdir(self, args) object *self; object *args; @@ -243,7 +234,7 @@ mac_listdir(self, args) char *name; object *d, *v; DIR *dirp; - struct direct *ep; + struct dirent *ep; if (!getargs(args, "s", &name)) return NULL; BGN_SAVE @@ -376,11 +367,17 @@ mac_stat(self, args) END_SAVE if (res != 0) return mac_error(); - return mkvalue("(llll)", + return mkvalue("(llllllllll)", (long)st.st_mode, + 0L /* st_ino */, + (long)st.st_dev, + (long)st.st_nlink, + (long)st.st_uid, + (long)st.st_gid, (long)st.st_size, - (long)st.st_rsize, - (long)st.st_mtime); + (long)st.st_atime, + (long)st.st_mtime, + (long)st.st_ctime); } static object * @@ -426,7 +423,6 @@ mac_write(self, args) } static struct methodlist mac_methods[] = { - {"access_", mac_access}, /* "access" is a Python reserved word */ {"chdir", mac_chdir}, {"close", mac_close}, #ifdef MPW |