- 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, "AuthTIS", 0, &cfg.try_tis_auth);
- 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, "NetHackKeypad", 0, &cfg.nethack_keypad);
- gppi (sesskey, "AltF4", 1, &cfg.alt_f4);
- gppi (sesskey, "AltSpace", 0, &cfg.alt_space);
- gppi (sesskey, "LdiscTerm", 0, &cfg.ldisc_term);
- 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, "FontCharSet", ANSI_CHARSET, &cfg.fontcharset);
- gppi (sesskey, "FontHeight", 10, &cfg.fontheight);
- gppi (sesskey, "FontVTMode", VT_OEMANSI, (int *)&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];
- int c0, c1, c2;
- sprintf(buf, "Colour%d", i);
- gpps (sesskey, buf, defaults[i], buf2, sizeof(buf2));
- if(sscanf(buf2, "%d,%d,%d", &c0, &c1, &c2) == 3) {
- cfg.colours[i][0] = c0;
- cfg.colours[i][1] = c1;
- cfg.colours[i][2] = c2;
- }
- }
- 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);
- }
- }
- gppi (sesskey, "KoiWinXlat", 0, &cfg.xlat_enablekoiwin);
- gppi (sesskey, "88592Xlat", 0, &cfg.xlat_88592w1250);
- gppi (sesskey, "CapsLockCyr", 0, &cfg.xlat_capslockcyr);
-
- 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;