2 * Copyright (c) 1999 Simon Tatham
3 * Copyright (c) 1999 Ben Harris
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 /* PuTTY test backends */
35 static const char *null_init(void *, void **, Conf *, char *, int, char **,
37 static const char *loop_init(void *, void **, Conf *, char *, int, char **,
39 static void null_free(void *);
40 static void loop_free(void *);
41 static void null_reconfig(void *, Conf *);
42 static int null_send(void *, char *, int);
43 static int loop_send(void *, char *, int);
44 static int null_sendbuffer(void *);
45 static void null_size(void *, int, int);
46 static void null_special(void *, Telnet_Special);
47 static const struct telnet_special *null_get_specials(void *handle);
48 static int null_connected(void *);
49 static int null_exitcode(void *);
50 static int null_sendok(void *);
51 static int null_ldisc(void *, int);
52 static void null_provide_ldisc(void *, void *);
53 static void null_provide_logctx(void *, void *);
54 static void null_unthrottle(void *, int);
55 static int null_cfg_info(void *);
57 Backend null_backend = {
58 null_init, null_free, null_reconfig, null_send, null_sendbuffer, null_size,
59 null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
60 null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
61 null_cfg_info, "null", -1, 0
64 Backend loop_backend = {
65 loop_init, loop_free, null_reconfig, loop_send, null_sendbuffer, null_size,
66 null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
67 null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
68 null_cfg_info, "loop", -1, 0
75 static const char *null_init(void *frontend_handle, void **backend_handle,
76 Conf *conf, char *host, int port,
77 char **realhost, int nodelay, int keepalive) {
82 static const char *loop_init(void *frontend_handle, void **backend_handle,
83 Conf *conf, char *host, int port,
84 char **realhost, int nodelay, int keepalive) {
85 struct loop_state *st = snew(struct loop_state);
87 st->term = frontend_handle;
92 static void null_free(void *handle)
97 static void loop_free(void *handle)
103 static void null_reconfig(void *handle, Conf *conf) {
107 static int null_send(void *handle, char *buf, int len) {
112 static int loop_send(void *handle, char *buf, int len) {
113 struct loop_state *st = handle;
115 return from_backend(st->term, 0, buf, len);
118 static int null_sendbuffer(void *handle) {
123 static void null_size(void *handle, int width, int height) {
127 static void null_special(void *handle, Telnet_Special code) {
131 static const struct telnet_special *null_get_specials (void *handle) {
136 static int null_connected(void *handle) {
141 static int null_exitcode(void *handle) {
146 static int null_sendok(void *handle) {
151 static void null_unthrottle(void *handle, int backlog) {
155 static int null_ldisc(void *handle, int option) {
160 static void null_provide_ldisc (void *handle, void *ldisc) {
164 static void null_provide_logctx(void *handle, void *logctx) {
168 static int null_cfg_info(void *handle)
177 * c-file-style: "simon"