-
- free(p);
-
- gpps (sesskey, "HostName", "", cfg.host, sizeof(cfg.host));
- gppi (sesskey, "PortNumber", default_port, &cfg.port);
- gpps (sesskey, "Protocol", "default", prot, 10);
- if (!strcmp(prot, "ssh"))
- cfg.protocol = PROT_SSH;
- else if (!strcmp(prot, "telnet"))
- cfg.protocol = PROT_TELNET;
- else if (!strcmp(prot, "raw"))
- cfg.protocol = PROT_RAW;
- else
- cfg.protocol = default_protocol;
-
- gppi (sesskey, "CloseOnExit", 1, &cfg.close_on_exit);
- gppi (sesskey, "WarnOnClose", 1, &cfg.warn_on_close);
- gpps (sesskey, "TerminalType", "xterm", cfg.termtype,
- sizeof(cfg.termtype));
- gpps (sesskey, "TerminalSpeed", "38400,38400", cfg.termspeed,
- sizeof(cfg.termspeed));
- {
- char buf[2*sizeof(cfg.environmt)], *p, *q;
- gpps (sesskey, "Environment", "", buf, sizeof(buf));
- p = buf;
- q = cfg.environmt;
- while (*p) {
- while (*p && *p != ',') {
- int c = *p++;
- if (c == '=')
- c = '\t';
- if (c == '\\')
- c = *p++;
- *p++ = c;
- }
- if (*p == ',') p++;
- *q++ = '\0';
- }
- *q = '\0';
- }
- gpps (sesskey, "UserName", "", cfg.username, sizeof(cfg.username));
- gppi (sesskey, "NoPTY", 0, &cfg.nopty);
- {
- char cipher[10];
- gpps (sesskey, "Cipher", "3des", cipher, 10);
- if (!strcmp(cipher, "blowfish"))
- cfg.cipher = CIPHER_BLOWFISH;
- else if (!strcmp(cipher, "des"))
- cfg.cipher = CIPHER_DES;
- else
- cfg.cipher = CIPHER_3DES;
- }
- gppi (sesskey, "RFCEnviron", 0, &cfg.rfc_environ);
- gppi (sesskey, "BackspaceIsDelete", 1, &cfg.bksp_is_delete);
- gppi (sesskey, "RXVTHomeEnd", 0, &cfg.rxvt_homeend);
- gppi (sesskey, "LinuxFunctionKeys", 0, &cfg.linux_funkeys);
- gppi (sesskey, "ApplicationCursorKeys", 0, &cfg.app_cursor);
- gppi (sesskey, "ApplicationKeypad", 0, &cfg.app_keypad);
- gppi (sesskey, "ScrollbackLines", 200, &cfg.savelines);
- gppi (sesskey, "DECOriginMode", 0, &cfg.dec_om);
- gppi (sesskey, "AutoWrapMode", 1, &cfg.wrap_mode);
- gppi (sesskey, "LFImpliesCR", 0, &cfg.lfhascr);
- gppi (sesskey, "WinNameAlways", 0, &cfg.win_name_always);
- gppi (sesskey, "TermWidth", 80, &cfg.width);
- gppi (sesskey, "TermHeight", 24, &cfg.height);
- gpps (sesskey, "Font", "Courier", cfg.font, sizeof(cfg.font));
- gppi (sesskey, "FontIsBold", 0, &cfg.fontisbold);
- gppi (sesskey, "FontHeight", 10, &cfg.fontheight);
- gppi (sesskey, "FontVTMode", VT_POORMAN, &cfg.vtmode);
- gppi (sesskey, "TryPalette", 0, &cfg.try_palette);
- gppi (sesskey, "BoldAsColour", 1, &cfg.bold_colour);
- for (i=0; i<22; i++) {
- static char *defaults[] = {
- "187,187,187", "255,255,255", "0,0,0", "85,85,85", "0,0,0",
- "0,255,0", "0,0,0", "85,85,85", "187,0,0", "255,85,85",
- "0,187,0", "85,255,85", "187,187,0", "255,255,85", "0,0,187",
- "85,85,255", "187,0,187", "255,85,255", "0,187,187",
- "85,255,255", "187,187,187", "255,255,255"
- };
- char buf[20], buf2[30];
- sprintf(buf, "Colour%d", i);
- gpps (sesskey, buf, defaults[i], buf2, sizeof(buf2));
- sscanf(buf2, "%d,%d,%d", &cfg.colours[i][0],
- &cfg.colours[i][1], &cfg.colours[i][2]);
- }
- gppi (sesskey, "MouseIsXterm", 0, &cfg.mouse_is_xterm);
- for (i=0; i<256; i+=32) {
- static char *defaults[] = {
- "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
- "0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1",
- "1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2",
- "1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1",
- "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1",
- "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1",
- "2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2",
- "2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2"
- };
- char buf[20], buf2[256], *p;
- int j;
- sprintf(buf, "Wordness%d", i);
- gpps (sesskey, buf, defaults[i/32], buf2, sizeof(buf2));
- p = buf2;
- for (j=i; j<i+32; j++) {
- char *q = p;
- while (*p && *p != ',') p++;
- if (*p == ',') *p++ = '\0';
- cfg.wordness[j] = atoi(q);
- }
- }
- RegCloseKey(sesskey);
-}
-
-static void MyGetDlgItemInt (HWND hwnd, int id, int *result) {
- BOOL ok;
- int n;
- n = GetDlgItemInt (hwnd, id, &ok, FALSE);
- if (ok)
- *result = n;