+ c2pstrcpy(pappname, appname);
+ c2pstrcpy(pkeytype, keytype);
+ c2pstrcpy(pfingerprint, fingerprint);
+
+ /*
+ * The alert shouldn't be modal, it should be movable modal, or
+ * a sheet in Aqua. Also, PuTTY might be in the background, in
+ * which case we should use the Notification Manager to wake up
+ * the user. In any case, we shouldn't hold up processing of
+ * other connections' data just because this one's waiting for
+ * the user.
+ */
+
+ /* Verify the key against the cache */
+
+ ret = verify_host_key(host, port, keytype, keystr);
+
+ if (ret == 0) { /* success - key matched OK */
+ return 1;
+ } else if (ret == 2) { /* key was different */
+ ParamText(pappname, pkeytype, pfingerprint, NULL);
+ alertret=CautionAlert(wWrong, NULL);
+ if (alertret == 8) {
+ /* Cancel */
+ return 0;
+ } else if (alertret == 9) {
+ /* Connect Just Once */
+ return 1;
+ } else {
+ /* Update Key */
+ store_host_key(host, port, keytype, keystr);
+ return 1;
+ }
+ } else /* ret == 1 */ { /* key was absent */
+ ParamText(pkeytype, pfingerprint, pappname, NULL);
+ alertret=CautionAlert(wAbsent, NULL);
+ if (alertret == 7) {
+ /* Cancel */
+ return 0;
+ } else if (alertret == 8) {
+ /* Connect Just Once */
+ return 1;
+ } else {
+ /* Update Key */
+ store_host_key(host, port, keytype, keystr);
+ return 1;
+ }
+ }
+}
+
+int askalg(void *frontend, const char *algtype, const char *algname,
+ void (*callback)(void *ctx, int result), void *ctx)
+{
+ return 0;
+}
+
+void old_keyfile_warning(void)
+{
+
+}
+
+FontSpec platform_default_fontspec(char const *name)
+{
+ FontSpec ret;
+ long smfs;
+
+ if (!strcmp(name, "Font")) {
+ smfs = GetScriptVariable(smSystemScript, smScriptMonoFondSize);
+ if (smfs == 0)
+ smfs = GetScriptVariable(smRoman, smScriptMonoFondSize);
+ if (smfs != 0) {
+ GetFontName(HiWord(smfs), ret.name);
+ if (ret.name[0] == 0)
+ memcpy(ret.name, "\pMonaco", 7);
+ ret.size = LoWord(smfs);
+ } else {
+ memcpy(ret.name, "\pMonaco", 7);
+ ret.size = 9;
+ }
+ ret.face = 0;
+ } else {
+ ret.name[0] = 0;
+ }
+
+ return ret;
+}
+
+Filename platform_default_filename(const char *name)
+{
+ Filename ret;
+ if (!strcmp(name, "LogFileName"))
+ FSMakeFSSpec(0, 0, "\pputty.log", &ret.fss);
+ else
+ memset(&ret, 0, sizeof(ret));
+ return ret;
+}
+
+char *platform_default_s(char const *name)
+{
+ return NULL;
+}
+
+int platform_default_i(char const *name, int def)
+{
+
+ /* Non-raw cut and paste of line-drawing chars works badly on the
+ * current Unix stub implementation of the Unicode functions.
+ * So I'm going to temporarily set the default to raw mode so
+ * that the failure mode isn't quite so drastically horrid.
+ * When Unicode comes in, this can all be put right. */
+ if (!strcmp(name, "RawCNP"))
+ return 1;
+ return def;
+}
+
+void platform_get_x11_auth(char *display, int *proto,
+ unsigned char *data, int *datalen)
+{
+ /* SGT: I have no idea whether Mac X servers need anything here. */
+}
+
+void update_specials_menu(void *frontend)
+{
+ Session *s = frontend;
+ WindowPtr front;
+
+ front = mac_frontwindow();
+ if (front != NULL && mac_windowsession(front) == s)
+ mac_adjustmenus();
+}
+
+void notify_remote_exit(void *frontend)
+{
+ Session *s = frontend;
+ int exitcode;
+
+ if (!s->session_closed &&
+ (exitcode = s->back->exitcode(s->backhandle)) >=0) {
+ s->session_closed = TRUE;
+ if (s->cfg.close_on_exit == FORCE_ON ||
+ (s->cfg.close_on_exit == AUTO && exitcode == 0)) {
+ mac_closewindow(s->window);
+ return;
+ }
+
+ /* The session's dead */
+
+ if (s->ldisc) {
+ ldisc_free(s->ldisc);
+ s->ldisc = NULL;
+ }
+
+ if (s->back) {
+ s->back->free(s->backhandle);
+ s->backhandle = NULL;
+ s->back = NULL;
+ update_specials_menu(s);
+ }
+
+ {
+ char title[100];
+ sprintf(title, "%.70s (inactive)", appname);
+ set_title(s, title);
+ }
+ }