OSDN Git Service

Modify features and documents for 1.98b the urgent security release.
[ffftp/ffftp.git] / contrib / putty / SERCFG.C
diff --git a/contrib/putty/SERCFG.C b/contrib/putty/SERCFG.C
deleted file mode 100644 (file)
index 86a8a0b..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*\r
- * sercfg.c - the serial-port specific parts of the PuTTY\r
- * configuration box. Centralised as cross-platform code because\r
- * more than one platform will want to use it, but not part of the\r
- * main configuration. The expectation is that each platform's\r
- * local config function will call out to ser_setup_config_box() if\r
- * it needs to set up the standard serial stuff. (Of course, it can\r
- * then apply local tweaks after ser_setup_config_box() returns, if\r
- * it needs to.)\r
- */\r
-\r
-#include <assert.h>\r
-#include <stdlib.h>\r
-\r
-#include "putty.h"\r
-#include "dialog.h"\r
-#include "storage.h"\r
-\r
-static void serial_parity_handler(union control *ctrl, void *dlg,\r
-                                 void *data, int event)\r
-{\r
-    static const struct {\r
-       const char *name;\r
-       int val;\r
-    } parities[] = {\r
-       {"None", SER_PAR_NONE},\r
-       {"Odd", SER_PAR_ODD},\r
-       {"Even", SER_PAR_EVEN},\r
-       {"Mark", SER_PAR_MARK},\r
-       {"Space", SER_PAR_SPACE},\r
-    };\r
-    int mask = ctrl->listbox.context.i;\r
-    int i, j;\r
-    Config *cfg = (Config *)data;\r
-\r
-    if (event == EVENT_REFRESH) {\r
-       int oldparity = cfg->serparity;/* preserve past reentrant calls */\r
-       dlg_update_start(ctrl, dlg);\r
-       dlg_listbox_clear(ctrl, dlg);\r
-       for (i = 0; i < lenof(parities); i++)  {\r
-           if (mask & (1 << i))\r
-               dlg_listbox_addwithid(ctrl, dlg, parities[i].name,\r
-                                     parities[i].val);\r
-       }\r
-       for (i = j = 0; i < lenof(parities); i++) {\r
-           if (mask & (1 << i)) {\r
-               if (oldparity == parities[i].val) {\r
-                   dlg_listbox_select(ctrl, dlg, j);\r
-                   break;\r
-               }\r
-               j++;\r
-           }\r
-       }\r
-       if (i == lenof(parities)) {    /* an unsupported setting was chosen */\r
-           dlg_listbox_select(ctrl, dlg, 0);\r
-           oldparity = SER_PAR_NONE;\r
-       }\r
-       dlg_update_done(ctrl, dlg);\r
-       cfg->serparity = oldparity;    /* restore */\r
-    } else if (event == EVENT_SELCHANGE) {\r
-       int i = dlg_listbox_index(ctrl, dlg);\r
-       if (i < 0)\r
-           i = SER_PAR_NONE;\r
-       else\r
-           i = dlg_listbox_getid(ctrl, dlg, i);\r
-       cfg->serparity = i;\r
-    }\r
-}\r
-\r
-static void serial_flow_handler(union control *ctrl, void *dlg,\r
-                               void *data, int event)\r
-{\r
-    static const struct {\r
-       const char *name;\r
-       int val;\r
-    } flows[] = {\r
-       {"None", SER_FLOW_NONE},\r
-       {"XON/XOFF", SER_FLOW_XONXOFF},\r
-       {"RTS/CTS", SER_FLOW_RTSCTS},\r
-       {"DSR/DTR", SER_FLOW_DSRDTR},\r
-    };\r
-    int mask = ctrl->listbox.context.i;\r
-    int i, j;\r
-    Config *cfg = (Config *)data;\r
-\r
-    if (event == EVENT_REFRESH) {\r
-       int oldflow = cfg->serflow;    /* preserve past reentrant calls */\r
-       dlg_update_start(ctrl, dlg);\r
-       dlg_listbox_clear(ctrl, dlg);\r
-       for (i = 0; i < lenof(flows); i++)  {\r
-           if (mask & (1 << i))\r
-               dlg_listbox_addwithid(ctrl, dlg, flows[i].name, flows[i].val);\r
-       }\r
-       for (i = j = 0; i < lenof(flows); i++) {\r
-           if (mask & (1 << i)) {\r
-               if (oldflow == flows[i].val) {\r
-                   dlg_listbox_select(ctrl, dlg, j);\r
-                   break;\r
-               }\r
-               j++;\r
-           }\r
-       }\r
-       if (i == lenof(flows)) {       /* an unsupported setting was chosen */\r
-           dlg_listbox_select(ctrl, dlg, 0);\r
-           oldflow = SER_FLOW_NONE;\r
-       }\r
-       dlg_update_done(ctrl, dlg);\r
-       cfg->serflow = oldflow;        /* restore */\r
-    } else if (event == EVENT_SELCHANGE) {\r
-       int i = dlg_listbox_index(ctrl, dlg);\r
-       if (i < 0)\r
-           i = SER_FLOW_NONE;\r
-       else\r
-           i = dlg_listbox_getid(ctrl, dlg, i);\r
-       cfg->serflow = i;\r
-    }\r
-}\r
-\r
-void ser_setup_config_box(struct controlbox *b, int midsession,\r
-                         int parity_mask, int flow_mask)\r
-{\r
-    struct controlset *s;\r
-    union control *c;\r
-\r
-    if (!midsession) {\r
-       int i;\r
-       extern void config_protocolbuttons_handler(union control *, void *,\r
-                                                  void *, int);\r
-\r
-       /*\r
-        * Add the serial back end to the protocols list at the\r
-        * top of the config box.\r
-        */\r
-       s = ctrl_getset(b, "Session", "hostport",\r
-                       "Specify the destination you want to connect to");\r
-\r
-        for (i = 0; i < s->ncontrols; i++) {\r
-            c = s->ctrls[i];\r
-           if (c->generic.type == CTRL_RADIO &&\r
-               c->generic.handler == config_protocolbuttons_handler) {\r
-               c->radio.nbuttons++;\r
-               c->radio.ncolumns++;\r
-               c->radio.buttons =\r
-                   sresize(c->radio.buttons, c->radio.nbuttons, char *);\r
-               c->radio.buttons[c->radio.nbuttons-1] =\r
-                   dupstr("Serial");\r
-               c->radio.buttondata =\r
-                   sresize(c->radio.buttondata, c->radio.nbuttons, intorptr);\r
-               c->radio.buttondata[c->radio.nbuttons-1] = I(PROT_SERIAL);\r
-               if (c->radio.shortcuts) {\r
-                   c->radio.shortcuts =\r
-                       sresize(c->radio.shortcuts, c->radio.nbuttons, char);\r
-                   c->radio.shortcuts[c->radio.nbuttons-1] = 'r';\r
-               }\r
-           }\r
-       }\r
-    }\r
-\r
-    /*\r
-     * Entirely new Connection/Serial panel for serial port\r
-     * configuration.\r
-     */\r
-    ctrl_settitle(b, "Connection/Serial",\r
-                 "Options controlling local serial lines");\r
-\r
-    if (!midsession) {\r
-       /*\r
-        * We don't permit switching to a different serial port in\r
-        * midflight, although we do allow all other\r
-        * reconfiguration.\r
-        */\r
-       s = ctrl_getset(b, "Connection/Serial", "serline",\r
-                       "Select a serial line");\r
-       ctrl_editbox(s, "Serial line to connect to", 'l', 40,\r
-                    HELPCTX(serial_line),\r
-                    dlg_stdeditbox_handler, I(offsetof(Config,serline)),\r
-                    I(sizeof(((Config *)0)->serline)));\r
-    }\r
-\r
-    s = ctrl_getset(b, "Connection/Serial", "sercfg", "Configure the serial line");\r
-    ctrl_editbox(s, "Speed (baud)", 's', 40,\r
-                HELPCTX(serial_speed),\r
-                dlg_stdeditbox_handler, I(offsetof(Config,serspeed)), I(-1));\r
-    ctrl_editbox(s, "Data bits", 'b', 40,\r
-                HELPCTX(serial_databits),\r
-                dlg_stdeditbox_handler,I(offsetof(Config,serdatabits)),I(-1));\r
-    /*\r
-     * Stop bits come in units of one half.\r
-     */\r
-    ctrl_editbox(s, "Stop bits", 't', 40,\r
-                HELPCTX(serial_stopbits),\r
-                dlg_stdeditbox_handler,I(offsetof(Config,serstopbits)),I(-2));\r
-    ctrl_droplist(s, "Parity", 'p', 40,\r
-                 HELPCTX(serial_parity),\r
-                 serial_parity_handler, I(parity_mask));\r
-    ctrl_droplist(s, "Flow control", 'f', 40,\r
-                 HELPCTX(serial_flow),\r
-                 serial_flow_handler, I(flow_mask));\r
-}\r