Guido van Rossum | b0f3c82 | 1994-08-23 13:34:25 +0000 | [diff] [blame] | 1 | /*********************************************************** |
| 2 | Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, |
| 3 | Amsterdam, The Netherlands. |
| 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 | |
| 25 | /* Macintosh Python main program */ |
| 26 | |
| 27 | #ifdef HAVE_CONFIG_H |
| 28 | #include "config.h" |
| 29 | #endif |
| 30 | |
Guido van Rossum | b0f3c82 | 1994-08-23 13:34:25 +0000 | [diff] [blame] | 31 | #ifdef THINK_C |
| 32 | #define CONSOLE_IO |
| 33 | #endif |
| 34 | |
| 35 | #include <stdio.h> |
| 36 | #include <string.h> |
| 37 | |
| 38 | #ifdef CONSOLE_IO |
| 39 | #include <console.h> |
| 40 | #endif |
| 41 | |
Jack Jansen | bac428d | 1994-12-14 13:47:30 +0000 | [diff] [blame^] | 42 | char *fileargument; |
| 43 | |
Guido van Rossum | b0f3c82 | 1994-08-23 13:34:25 +0000 | [diff] [blame] | 44 | main(argc, argv) |
| 45 | int argc; |
| 46 | char **argv; |
| 47 | { |
| 48 | #ifdef USE_STDWIN |
| 49 | /* Use STDWIN's wargs() to set argc/argv to list of files to open */ |
| 50 | wargs(&argc, &argv); |
| 51 | /* Put About Python... in Apple menu */ |
| 52 | { |
| 53 | extern char *about_message; |
| 54 | extern char *about_item; |
| 55 | extern char *getversion(), *getcopyright(); |
Jack Jansen | bac428d | 1994-12-14 13:47:30 +0000 | [diff] [blame^] | 56 | static char buf[1024]; |
Guido van Rossum | b0f3c82 | 1994-08-23 13:34:25 +0000 | [diff] [blame] | 57 | sprintf(buf, "Python %s\r\ |
| 58 | \r\ |
| 59 | %s\r\ |
| 60 | \r\ |
| 61 | Author: Guido van Rossum <guido@cwi.nl>\r\ |
| 62 | FTP: host ftp.cwi.nl, directory pub/python\r\ |
| 63 | Newsgroup: comp.lang.python\r\ |
| 64 | \r\ |
| 65 | Motto: \"Nobody expects the Spanish Inquisition!\"", |
| 66 | getversion(), getcopyright()); |
| 67 | about_message = buf; |
| 68 | about_item = "About Python..."; |
| 69 | } |
| 70 | #endif /* USE_STDWIN */ |
| 71 | #ifdef CONSOLE_IO |
| 72 | if (argc >= 1 && argv[0][0] != '\0') { |
| 73 | static char buf[256]; |
| 74 | buf[0] = strlen(argv[0]); |
| 75 | strncpy(buf+1, argv[0], buf[0]); |
| 76 | console_options.title = (unsigned char *)buf; |
| 77 | } |
| 78 | else |
| 79 | console_options.title = "\pPython"; |
| 80 | #endif /* CONSOLE_IO */ |
Jack Jansen | bac428d | 1994-12-14 13:47:30 +0000 | [diff] [blame^] | 81 | if ( argc > 1 ) |
| 82 | fileargument = argv[1]; /* Mod by Jack to do chdir */ |
Guido van Rossum | b0f3c82 | 1994-08-23 13:34:25 +0000 | [diff] [blame] | 83 | realmain(argc, argv); |
| 84 | } |