wppi (sesskey, "LinuxFunctionKeys", cfg.linux_funkeys);
wppi (sesskey, "LinuxFunctionKeys", cfg.funky_type);
static void save_settings (char *section, int do_host) {    int i;    HKEY subkey1, sesskey;    char *p;    p = malloc(3*strlen(section)+1);    mungestr(section, p);        if (RegCreateKey(HKEY_CURRENT_USER, puttystr, &subkey1)!=ERROR_SUCCESS ||	RegCreateKey(subkey1, p, &sesskey) != ERROR_SUCCESS) {	sesskey = NULL;    }    free(p);    RegCloseKey(subkey1);    wppi (sesskey, "Present", 1);    if (do_host) {	wpps (sesskey, "HostName", cfg.host);	wppi (sesskey, "PortNumber", cfg.port);        p = "raw";        for (i = 0; backends[i].name != NULL; i++)            if (backends[i].protocol == cfg.protocol) {                p = backends[i].name;                break;            }        wpps (sesskey, "Protocol", p);    }    wppi (sesskey, "CloseOnExit", !!cfg.close_on_exit);    wppi (sesskey, "WarnOnClose", !!cfg.warn_on_close);    wpps (sesskey, "TerminalType", cfg.termtype);    wpps (sesskey, "TerminalSpeed", cfg.termspeed);    {      char buf[2*sizeof(cfg.environmt)], *p, *q;	p = buf;      q = cfg.environmt;	while (*q) {	    while (*q) {		int c = *q++;		if (c == '=' || c == ',' || c == '\\')		    *p++ = '\\';		if (c == '\t')		    c = '=';		*p++ = c;	    }	    *p++ = ',';	    q++;	}	*p = '\0';	wpps (sesskey, "Environment", buf);    }    wpps (sesskey, "UserName", cfg.username);    wppi (sesskey, "NoPTY", cfg.nopty);    wpps (sesskey, "Cipher", cfg.cipher == CIPHER_BLOWFISH ? "blowfish" :                             cfg.cipher == CIPHER_DES ? "des" : "3des");    wppi (sesskey, "AuthTIS", cfg.try_tis_auth);    wppi (sesskey, "RFCEnviron", cfg.rfc_environ);    wppi (sesskey, "BackspaceIsDelete", cfg.bksp_is_delete);    wppi (sesskey, "RXVTHomeEnd", cfg.rxvt_homeend);    wppi (sesskey, "LinuxFunctionKeys", cfg.linux_funkeys);    wppi (sesskey, "ApplicationCursorKeys", cfg.app_cursor);    wppi (sesskey, "ApplicationKeypad", cfg.app_keypad);    wppi (sesskey, "NetHackKeypad", cfg.nethack_keypad);    wppi (sesskey, "AltF4", cfg.alt_f4);    wppi (sesskey, "AltSpace", cfg.alt_space);    wppi (sesskey, "LdiscTerm", cfg.ldisc_term);    wppi (sesskey, "BlinkCur", cfg.blink_cur);    wppi (sesskey, "Beep", cfg.beep);    wppi (sesskey, "ScrollbackLines", cfg.savelines);    wppi (sesskey, "DECOriginMode", cfg.dec_om);    wppi (sesskey, "AutoWrapMode", cfg.wrap_mode);    wppi (sesskey, "LFImpliesCR", cfg.lfhascr);    wppi (sesskey, "WinNameAlways", cfg.win_name_always);    wppi (sesskey, "TermWidth", cfg.width);    wppi (sesskey, "TermHeight", cfg.height);    wpps (sesskey, "Font", cfg.font);    wppi (sesskey, "FontIsBold", cfg.fontisbold);    wppi (sesskey, "FontCharSet", cfg.fontcharset);    wppi (sesskey, "FontHeight", cfg.fontheight);    wppi (sesskey, "FontVTMode", cfg.vtmode);    wppi (sesskey, "TryPalette", cfg.try_palette);    wppi (sesskey, "BoldAsColour", cfg.bold_colour);    for (i=0; i<22; i++) {	char buf[20], buf2[30];	sprintf(buf, "Colour%d", i);	sprintf(buf2, "%d,%d,%d", cfg.colours[i][0],		cfg.colours[i][1], cfg.colours[i][2]);	wpps (sesskey, buf, buf2);    }    wppi (sesskey, "MouseIsXterm", cfg.mouse_is_xterm);    for (i=0; i<256; i+=32) {	char buf[20], buf2[256];	int j;	sprintf(buf, "Wordness%d", i);	*buf2 = '\0';	for (j=i; j<i+32; j++) {	    sprintf(buf2+strlen(buf2), "%s%d",		    (*buf2 ? "," : ""), cfg.wordness[j]);	}	wpps (sesskey, buf, buf2);    }    wppi (sesskey, "KoiWinXlat", cfg.xlat_enablekoiwin);    wppi (sesskey, "88592Xlat", cfg.xlat_88592w1250);    wppi (sesskey, "CapsLockCyr", cfg.xlat_capslockcyr);    RegCloseKey(sesskey);}