From fadb1e0f547cb3a8759a47f5a4e15a61fb12f96e Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Fri, 19 Feb 1999 21:35:12 +0000 Subject: [PATCH] Now initialises enough to be able to generate fatal errors. [originally from svn r43] --- mac.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 mac.c diff --git a/mac.c b/mac.c new file mode 100644 index 00000000..e694cec4 --- /dev/null +++ b/mac.c @@ -0,0 +1,52 @@ +/* $Id: mac.c,v 1.1.2.1 1999/02/19 21:35:12 ben Exp $ */ +/* + * mac.c -- miscellaneous Mac-specific routines + */ + +#include +#include +#include +#include +#include +#include +#include + +#include /* putty.h needs size_t */ +#include + +#include "putty.h" + +QDGlobals qd; + +int cold = 1; + +int main (int argc, char **argv) { + /* Init QuickDraw */ + InitGraf(&qd.thePort); + /* Init Font Manager */ + InitFonts(); + /* Init Window Manager */ + InitWindows(); + /* Init Menu Manager */ + InitMenus(); + /* Init TextEdit */ + TEInit(); + /* Init Dialog Manager */ + InitDialogs(nil); + InitCursor(); + cold = 0; + fatalbox("Init complete"); +} + +void fatalbox(const char *fmt, ...) { + va_list ap; + Str255 stuff; + + va_start(ap, fmt); + /* We'd like stuff to be a Pascal string */ + stuff[0] = vsprintf((char *)(&stuff[1]), fmt, ap); + va_end(ap); + ParamText(stuff, NULL, NULL, NULL); + StopAlert(128, nil); + exit(1); +}