X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/f854b482e4de775e380033bbea7436732311d1ce..7440fd4419acfc9c784f142fb9dee3e64c9a18c2:/mac/macterm.c diff --git a/mac/macterm.c b/mac/macterm.c index d04abd33..88eb2668 100644 --- a/mac/macterm.c +++ b/mac/macterm.c @@ -1,4 +1,4 @@ -/* $Id: macterm.c,v 1.71 2003/02/15 16:22:15 ben Exp $ */ +/* $Id: macterm.c,v 1.75 2003/05/04 14:18:18 simon Exp $ */ /* * Copyright (c) 1999 Simon Tatham * Copyright (c) 1999, 2002 Ben Harris @@ -105,7 +105,7 @@ void post_paint(Session *s); void mac_startsession(Session *s) { - char *errmsg; + const char *errmsg; int i; WinInfo *wi; @@ -129,7 +129,7 @@ void mac_startsession(Session *s) s->window = GetNewCWindow(wTerminal, NULL, (WindowPtr)-1); else s->window = GetNewWindow(wTerminal, NULL, (WindowPtr)-1); - wi = smalloc(sizeof(*wi)); + wi = snew(WinInfo); memset(wi, 0, sizeof(*wi)); wi->s = s; wi->wtype = wTerminal; @@ -157,7 +157,7 @@ void mac_startsession(Session *s) s->logctx = log_init(s->term, &s->cfg); term_provide_logctx(s->term, s->logctx); - errmsg = s->back->init(s->term, &s->backhandle, &s->cfg, s->cfg.host, + errmsg = s->back->init(s, &s->backhandle, &s->cfg, s->cfg.host, s->cfg.port, &s->realhost, s->cfg.tcp_nodelay); if (errmsg != NULL) fatalbox("%s", errmsg); @@ -193,9 +193,9 @@ static void mac_workoutfontscale(Session *s, int wantwidth, const char text = 'W'; FontInfo fi; #if TARGET_API_MAC_CARBON - CQDProcsPtr gp = GetPortGrafProcs(GetWindowPort(s->window));; + CQDProcsPtr gp = GetPortGrafProcs(GetWindowPort(s->window)); #else - QDProcsPtr gp = s->window->grafProcs;; + QDProcsPtr gp = s->window->grafProcs; #endif numer.v = denom.v = 1; /* always */ @@ -629,7 +629,7 @@ void write_clip(void *cookie, wchar_t *data, int len, int must_deselect) if (data[i] == 0x2028) data[i] = 0x000d; - mactextbuf = smalloc(len); /* XXX DBCS */ + mactextbuf = snewn(len, char); /* XXX DBCS */ if (s->uni_to_font != NULL) { err = ConvertFromUnicodeToText(s->uni_to_font, len * sizeof(UniChar), (UniChar *)data, @@ -702,7 +702,7 @@ void get_clip(void *frontend, wchar_t **p, int *lenp) texth = NewHandle(0); textlen = GetScrap(texth, kScrapFlavorTypeText, &offset); HLock(texth); - data = smalloc(textlen * 2); + data = snewn(textlen, wchar_t); /* XXX should use 'styl' scrap if it's there. */ if (mac_gestalts.encvvers != 0 && UpgradeScriptInfoToTextEncoding(smSystemScript, @@ -1847,6 +1847,13 @@ int askappend(void *frontend, Filename filename) return 2; } +int from_backend(void *frontend, int is_stderr, const char *data, int len) +{ + Session *s = frontend; + + return term_data(s->term, is_stderr, data, len); +} + /* * Emacs magic: * Local Variables: