gppi (sesskey, "AlwaysOnTop", 0, &cfg->alwaysontop);
void load_settings (char *section, int do_host, Config *cfg) {    int i;    char prot[10];    void *sesskey;    sesskey = open_settings_r(section);    gpps (sesskey, "HostName", "", cfg->host, sizeof(cfg->host));    gppi (sesskey, "PortNumber", default_port, &cfg->port);    gpps (sesskey, "Protocol", "default", prot, 10);    cfg->protocol = default_protocol;    for (i = 0; backends[i].name != NULL; i++)        if (!strcmp(prot, backends[i].name)) {            cfg->protocol = backends[i].protocol;            break;        }    gppi (sesskey, "CloseOnExit", 1, &cfg->close_on_exit);    gppi (sesskey, "WarnOnClose", 1, &cfg->warn_on_close);    gppi (sesskey, "PingInterval", 0, &cfg->ping_interval);    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++;		*q++ = c;	    }	    if (*p == ',') p++;	    *q++ = '\0';	}	*q = '\0';    }    gpps (sesskey, "UserName", "", cfg->username, sizeof(cfg->username));    gppi (sesskey, "NoPTY", 0, &cfg->nopty);    gppi (sesskey, "AgentFwd", 0, &cfg->agentfwd);    gpps (sesskey, "RemoteCmd", "", cfg->remote_cmd, sizeof(cfg->remote_cmd));    {	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, "SshProt", 1, &cfg->sshprot);    gppi (sesskey, "BuggyMAC", 0, &cfg->buggymac);    gppi (sesskey, "AuthTIS", 0, &cfg->try_tis_auth);    gpps (sesskey, "PublicKeyFile", "", cfg->keyfile, sizeof(cfg->keyfile));    gpps (sesskey, "RemoteCommand", "", cfg->remote_cmd,          sizeof(cfg->remote_cmd));    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->funky_type);    gppi (sesskey, "NoApplicationKeys", 0, &cfg->no_applic_k);    gppi (sesskey, "NoApplicationCursors", 0, &cfg->no_applic_c);    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, "AltOnly", 0, &cfg->alt_only);    gppi (sesskey, "ComposeKey", 0, &cfg->compose_key);    gppi (sesskey, "LdiscTerm", 0, &cfg->ldisc_term);    gppi (sesskey, "BlinkCur", 0, &cfg->blink_cur);    gppi (sesskey, "Beep", 1, &cfg->beep);    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);    gpps (sesskey, "WinTitle", "", cfg->wintitle, sizeof(cfg->wintitle));    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, "88592-CP852", 0, &cfg->xlat_88592cp852);    gppi (sesskey, "CapsLockCyr", 0, &cfg->xlat_capslockcyr);    gppi (sesskey, "ScrollBar", 1, &cfg->scrollbar);    gppi (sesskey, "ScrollOnKey", 0, &cfg->scroll_on_key);    gppi (sesskey, "ScrollOnDisp", 1, &cfg->scroll_on_disp);    gppi (sesskey, "LockSize", 0, &cfg->locksize);    gppi (sesskey, "BCE", 0, &cfg->bce);    gppi (sesskey, "BlinkText", 0, &cfg->blinktext);    close_settings_r(sesskey);}