Sebastian Kuschel reports that pfd_closing can be called for a socket
[u/mdw/putty] / testback.c
index 70f2295..be1faf4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: testback.c,v 1.5 2003/01/12 16:11:27 ben Exp $ */
+/* $Id$ */
 /*
  * Copyright (c) 1999 Simon Tatham
  * Copyright (c) 1999 Ben Harris
 
 #include "putty.h"
 
-static char *null_init(void *, void **, Config *, char *, int, char **, int);
-static char *loop_init(void *, void **, Config *, char *, int, char **, int);
-static void null_reconfig(void *, Config *);
+static const char *null_init(void *, void **, Conf *, char *, int, char **,
+                            int, int);
+static const char *loop_init(void *, void **, Conf *, char *, int, char **,
+                            int, int);
+static void null_free(void *);
+static void loop_free(void *);
+static void null_reconfig(void *, Conf *);
 static int null_send(void *, char *, int);
 static int loop_send(void *, char *, int);
 static int null_sendbuffer(void *);
 static void null_size(void *, int, int);
 static void null_special(void *, Telnet_Special);
-static Socket null_socket(void *);
+static const struct telnet_special *null_get_specials(void *handle);
+static int null_connected(void *);
 static int null_exitcode(void *);
 static int null_sendok(void *);
 static int null_ldisc(void *, int);
 static void null_provide_ldisc(void *, void *);
 static void null_provide_logctx(void *, void *);
 static void null_unthrottle(void *, int);
+static int null_cfg_info(void *);
 
 Backend null_backend = {
-    null_init, null_reconfig, null_send, null_sendbuffer, null_size,
-    null_special, null_socket, null_exitcode, null_sendok, null_ldisc,
-    null_provide_ldisc, null_provide_logctx, null_unthrottle, 0
+    null_init, null_free, null_reconfig, null_send, null_sendbuffer, null_size,
+    null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
+    null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
+    null_cfg_info, "null", -1, 0
 };
 
 Backend loop_backend = {
-    loop_init, null_reconfig, loop_send, null_sendbuffer, null_size,
-    null_special, null_socket, null_exitcode, null_sendok, null_ldisc,
-    null_provide_ldisc, null_provide_logctx, null_unthrottle, 0
+    loop_init, loop_free, null_reconfig, loop_send, null_sendbuffer, null_size,
+    null_special, null_get_specials, null_connected, null_exitcode, null_sendok,
+    null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle,
+    null_cfg_info, "loop", -1, 0
 };
 
 struct loop_state {
     Terminal *term;
 };
 
-static char *null_init(void *frontend_handle, void **backend_handle,
-                      Config *cfg, char *host, int port, char **realhost,
-                      int nodelay) {
+static const char *null_init(void *frontend_handle, void **backend_handle,
+                            Conf *conf, char *host, int port,
+                            char **realhost, int nodelay, int keepalive) {
 
     return NULL;
 }
 
-static char *loop_init(void *frontend_handle, void **backend_handle,
-                      Config *cfg, char *host, int port, char **realhost,
-                      int nodelay) {
-    struct loop_state *st = smalloc(sizeof(*st));
+static const char *loop_init(void *frontend_handle, void **backend_handle,
+                            Conf *conf, char *host, int port,
+                            char **realhost, int nodelay, int keepalive) {
+    struct loop_state *st = snew(struct loop_state);
 
     st->term = frontend_handle;
     *backend_handle = st;
     return NULL;
 }
 
-static void null_reconfig(void *handle, Config *cfg) {
+static void null_free(void *handle)
+{
+
+}
+
+static void loop_free(void *handle)
+{
+
+    sfree(handle);
+}
+
+static void null_reconfig(void *handle, Conf *conf) {
 
 }
 
@@ -110,11 +129,16 @@ static void null_special(void *handle, Telnet_Special code) {
 
 }
 
-static Socket null_socket(void *handle) {
+static const struct telnet_special *null_get_specials (void *handle) {
 
     return NULL;
 }
 
+static int null_connected(void *handle) {
+
+    return 0;
+}
+
 static int null_exitcode(void *handle) {
 
     return 0;
@@ -142,6 +166,12 @@ static void null_provide_logctx(void *handle, void *logctx) {
 
 }
 
+static int null_cfg_info(void *handle)
+{
+    return 0;
+}
+
+
 /*
  * Emacs magic:
  * Local Variables: