]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - testback.c
First attempt at copying to the clipboard -- doesn't seem to work.
[PuTTY.git] / testback.c
1 /* $Id: testback.c,v 1.1.2.1 1999/03/07 23:23:38 ben Exp $ */
2 /*
3  * Copyright (c) 1999 Simon Tatham
4  * Copyright (c) 1999 Ben Harris
5  * All rights reserved.
6  *
7  * Permission is hereby granted, free of charge, to any person
8  * obtaining a copy of this software and associated documentation
9  * files (the "Software"), to deal in the Software without
10  * restriction, including without limitation the rights to use,
11  * copy, modify, merge, publish, distribute, sublicense, and/or
12  * sell copies of the Software, and to permit persons to whom the
13  * Software is furnished to do so, subject to the following
14  * conditions:
15  * 
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  * 
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
23  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
24  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26  * SOFTWARE.
27  */
28
29 /* PuTTY test backends */
30
31 #include <stdlib.h>
32
33 #include "putty.h"
34
35 static char *null_init(char *, int, char **);
36 static int null_msg(void);
37 static void null_send(char *, int);
38 static void loop_send(*char *, int);
39 static void null_size(void);
40 static void null_special(Telnet_Special);
41
42 Backend null_backend = {
43     null_init, null_msg, null_send, null_size, null_special
44 };
45
46 Backend loop_backend = {
47     null_init, null_msg, loop_send, null_size, null_special
48 };
49
50 static char *null_init(char *host, int port, char **realhost) {
51
52     return NULL;
53 }
54
55 static int null_msg(void) {
56
57     return 1;
58 }
59
60 static void null_send(char *buf, int len) {
61
62 }
63
64 static void lo_send (char *buf, int len) {
65     while (len--) {
66         int new_head = (inbuf_head + 1) & INBUF_MASK;
67         int c = (unsigned char) *buf;
68         if (new_head != inbuf_reap) {
69             inbuf[inbuf_head] = *buf++;
70             inbuf_head = new_head;
71         }
72     }
73 }
74
75
76
77 static void null_size(void) {
78
79 }
80
81 static void null_special(Telnet_Special code) {
82
83 }