X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=testback.c;h=9ca9c49e7e6e1399e5e1879ed458cbfde93b3f22;hb=6b362191f1a2c6897e7b7bfa80beec1cd1f722fd;hp=f3e7614a6cb7a7a18b1673a02c9ad00c424c7e65;hpb=c0b887a0a249ee554d68ac5640519bcc1cbb3c7b;p=PuTTY.git diff --git a/testback.c b/testback.c index f3e7614a..9ca9c49e 100644 --- a/testback.c +++ b/testback.c @@ -1,4 +1,4 @@ -/* $Id: testback.c,v 1.3 2002/11/23 19:58:55 ben Exp $ */ +/* $Id: testback.c,v 1.8 2003/04/05 14:32:58 ben Exp $ */ /* * Copyright (c) 1999 Simon Tatham * Copyright (c) 1999 Ben Harris @@ -33,13 +33,17 @@ #include "putty.h" -static char *null_init(void *, void **, char *, int, char **, int); -static char *loop_init(void *, void **, char *, int, char **, int); +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_free(void *); +static void loop_free(void *); +static void null_reconfig(void *, Config *); 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 const struct telnet_special *null_get_specials(void *handle); static Socket null_socket(void *); static int null_exitcode(void *); static int null_sendok(void *); @@ -49,15 +53,15 @@ static void null_provide_logctx(void *, void *); static void null_unthrottle(void *, int); Backend null_backend = { - null_init, 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_socket, null_exitcode, null_sendok, + null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle, 0 }; Backend loop_backend = { - loop_init, 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_socket, null_exitcode, null_sendok, + null_ldisc, null_provide_ldisc, null_provide_logctx, null_unthrottle, 0 }; struct loop_state { @@ -65,20 +69,37 @@ struct loop_state { }; static char *null_init(void *frontend_handle, void **backend_handle, - char *host, int port, char **realhost, int nodelay) { + Config *cfg, char *host, int port, char **realhost, + int nodelay) { return NULL; } static char *loop_init(void *frontend_handle, void **backend_handle, - char *host, int port, char **realhost, int nodelay) { - struct loop_state *st = smalloc(sizeof(*st)); + Config *cfg, char *host, int port, char **realhost, + int nodelay) { + struct loop_state *st = snew(struct loop_state); st->term = frontend_handle; *backend_handle = st; return NULL; } +static void null_free(void *handle) +{ + +} + +static void loop_free(void *handle) +{ + + sfree(handle); +} + +static void null_reconfig(void *handle, Config *cfg) { + +} + static int null_send(void *handle, char *buf, int len) { return 0; @@ -86,12 +107,7 @@ static int null_send(void *handle, char *buf, int len) { static int loop_send(void *handle, char *buf, int len) { struct loop_state *st = handle; - int i; - fprintf(stderr, "%d chars: ", len); - for (i = 0; i < len; i++) - fprintf(stderr, " 0x%x", buf[i]); - fprintf(stderr, "\n"); return from_backend(st->term, 0, buf, len); } @@ -108,6 +124,11 @@ static void null_special(void *handle, Telnet_Special code) { } +static const struct telnet_special *null_get_specials (void *handle) { + + return NULL; +} + static Socket null_socket(void *handle) { return NULL;