Sebastian Kuschel reports that pfd_closing can be called for a socket
[u/mdw/putty] / unix / uxcfg.c
CommitLineData
1d0d4a3b 1/*
2 * uxcfg.c - the Unix-specific parts of the PuTTY configuration
3 * box.
4 */
5
6#include <assert.h>
7#include <stdlib.h>
8
9#include "putty.h"
10#include "dialog.h"
11#include "storage.h"
12
8a7f1392 13void unix_setup_config_box(struct controlbox *b, int midsession, int protocol)
1d0d4a3b 14{
8d68f26a 15 struct controlset *s;
1d0d4a3b 16 union control *c;
1d0d4a3b 17
18 /*
4a693cfc 19 * The Conf structure contains two Unix-specific elements which
20 * are not configured in here: stamp_utmp and login_shell. This
21 * is because pterm does not put up a configuration box right at
22 * the start, which is the only time when these elements would
23 * be useful to configure.
1d0d4a3b 24 */
25
26 /*
0f915619 27 * On Unix, we don't have a drop-down list for the printer
28 * control.
29 */
30 s = ctrl_getset(b, "Terminal", "printing", "Remote-controlled printing");
31 assert(s->ncontrols == 1 && s->ctrls[0]->generic.type == CTRL_EDITBOX);
32 s->ctrls[0]->editbox.has_list = 0;
33
34 /*
0f0a2507 35 * Unix supports a local-command proxy. This also means we must
36 * adjust the text on the `Telnet command' control.
37 */
2ce7b782 38 if (!midsession) {
0f0a2507 39 int i;
2ce7b782 40 s = ctrl_getset(b, "Connection/Proxy", "basics", NULL);
0f0a2507 41 for (i = 0; i < s->ncontrols; i++) {
42 c = s->ctrls[i];
43 if (c->generic.type == CTRL_RADIO &&
4a693cfc 44 c->generic.context.i == CONF_proxy_type) {
45 assert(c->generic.handler == conf_radiobutton_handler);
0f0a2507 46 c->radio.nbuttons++;
0f0a2507 47 c->radio.buttons =
48 sresize(c->radio.buttons, c->radio.nbuttons, char *);
49 c->radio.buttons[c->radio.nbuttons-1] =
50 dupstr("Local");
51 c->radio.buttondata =
52 sresize(c->radio.buttondata, c->radio.nbuttons, intorptr);
53 c->radio.buttondata[c->radio.nbuttons-1] = I(PROXY_CMD);
54 break;
55 }
56 }
10068a0b 57
0f0a2507 58 for (i = 0; i < s->ncontrols; i++) {
59 c = s->ctrls[i];
60 if (c->generic.type == CTRL_EDITBOX &&
4a693cfc 61 c->generic.context.i == CONF_proxy_telnet_command) {
62 assert(c->generic.handler == conf_editbox_handler);
0f0a2507 63 sfree(c->generic.label);
64 c->generic.label = dupstr("Telnet command, or local"
65 " proxy command");
66 break;
67 }
68 }
69 }
70
aef05b78 71 /*
72 * Serial back end is available on Unix. However, we have to
73 * mask out a couple of the configuration options: mark and
74 * space parity are not conveniently supported, and neither is
75 * DSR/DTR flow control.
76 */
8a7f1392 77 if (!midsession || (protocol == PROT_SERIAL))
78 ser_setup_config_box(b, midsession, 0x07, 0x07);
1d0d4a3b 79}