blob: b706464ef5234788b199c85c4de60b8836301261 [file] [log] [blame]
Guido van Rossumb0f3c821994-08-23 13:34:25 +00001/***********************************************************
2Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
3Amsterdam, The Netherlands.
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI not be used in advertising or publicity pertaining to
13distribution of the software without specific, written prior permission.
14
15STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21OF 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 Rossumb0f3c821994-08-23 13:34:25 +000031#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 Jansenbac428d1994-12-14 13:47:30 +000042char *fileargument;
43
Guido van Rossumb0f3c821994-08-23 13:34:25 +000044main(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 Jansenbac428d1994-12-14 13:47:30 +000056 static char buf[1024];
Guido van Rossumb0f3c821994-08-23 13:34:25 +000057 sprintf(buf, "Python %s\r\
58\r\
59%s\r\
60\r\
61Author: Guido van Rossum <guido@cwi.nl>\r\
62FTP: host ftp.cwi.nl, directory pub/python\r\
63Newsgroup: comp.lang.python\r\
64\r\
65Motto: \"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 Jansenbac428d1994-12-14 13:47:30 +000081 if ( argc > 1 )
82 fileargument = argv[1]; /* Mod by Jack to do chdir */
Guido van Rossumb0f3c821994-08-23 13:34:25 +000083 realmain(argc, argv);
84}