blob: 19c3ab16330439b49302acf1a862e98fc573e62b [file] [log] [blame]
Jack Jansen76efd8e1995-02-24 22:53:16 +00001/***********************************************************
Jack Jansen42218ce1997-01-31 16:15:11 +00002Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam,
Jack Jansen76efd8e1995-02-24 22:53:16 +00003The 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
Jack Jansen6b6e61d1999-02-15 21:33:34 +000025/* Macintosh Python main program for both applets and interpreter */
Jack Jansen76efd8e1995-02-24 22:53:16 +000026
Jack Jansen6b6e61d1999-02-15 21:33:34 +000027#include <Resources.h>
28
29#ifdef __CFM68K__
Jack Jansen76efd8e1995-02-24 22:53:16 +000030#pragma lib_export on
31#endif
32
Jack Jansen6b6e61d1999-02-15 21:33:34 +000033extern void PyMac_InitApplet();
Jack Jansen68ecab41999-02-15 23:34:56 +000034#ifdef USE_MAC_APPLET_SUPPORT
Jack Jansen76efd8e1995-02-24 22:53:16 +000035extern void PyMac_InitApplication();
Jack Jansen68ecab41999-02-15 23:34:56 +000036#endif /* USE_MAC_APPLET_SUPPORT */
Jack Jansen76efd8e1995-02-24 22:53:16 +000037
Jack Jansen499a8af1996-08-19 11:38:03 +000038void
Jack Jansen76efd8e1995-02-24 22:53:16 +000039main() {
Jack Jansen68ecab41999-02-15 23:34:56 +000040#ifdef USE_MAC_APPLET_SUPPORT
Jack Jansen6b6e61d1999-02-15 21:33:34 +000041 Handle mainpyc;
42
43 mainpyc = Get1NamedResource('PYC ', "\p__main__");
44 if (mainpyc != NULL)
45 PyMac_InitApplet();
46 else
47 PyMac_InitApplication();
Jack Jansen68ecab41999-02-15 23:34:56 +000048#else
49 PyMac_InitApplication();
50#endif /* USE_MAC_APPLET_SUPPORT */
Jack Jansen76efd8e1995-02-24 22:53:16 +000051}