1 /* $Id: mac.c,v 1.1.2.3 1999/02/19 23:51:21 ben Exp $ */
3 * mac.c -- miscellaneous Mac-specific routines
9 #include <MacWindows.h>
16 #include <stdlib.h> /* putty.h needs size_t */
24 static void mac_startup(void);
25 static void mac_eventloop(void);
27 int main (int argc, char **argv) {
33 static void mac_startup(void) {
37 InitGraf(&qd.thePort);
38 /* Init Font Manager */
40 /* Init Window Manager */
42 /* Init Menu Manager */
46 /* Init Dialog Manager */
51 menuBar = GetNewMBar(128);
53 fatalbox("Unable to create menu bar.");
55 AppendResMenu(GetMenuHandle(128), 'DRVR');
60 static void mac_eventloop(void) {
65 for (i = 0; i < 100; i++) {
66 gotevent = WaitNextEvent(everyEvent, &event, LONG_MAX, NULL);
68 fatalbox("I'm bored.");
71 void fatalbox(const char *fmt, ...) {
76 /* We'd like stuff to be a Pascal string */
77 stuff[0] = vsprintf((char *)(&stuff[1]), fmt, ap);
79 ParamText(stuff, NULL, NULL, NULL);