Redo a mis-fix of a memory leak in r9919: I added sfree(data)
[sgt/putty] / contrib / cygtermd / telnet.h
CommitLineData
5e4a475d 1/*
2 * Header declaring Telnet-handling functions.
3 */
4
5#ifndef FIXME_TELNET_H
6#define FIXME_TELNET_H
7
8#include "sel.h"
9
10typedef struct telnet_tag *Telnet;
11
12struct shell_data {
13 char **envvars; /* array of "VAR=value" terms */
14 int nenvvars;
15 char *termtype;
16};
17
18/*
19 * Create and destroy a Telnet structure.
20 */
21Telnet telnet_new(sel_wfd *net, sel_wfd *pty);
22void telnet_free(Telnet telnet);
23
24/*
25 * Process data read from the pty.
26 */
27void telnet_from_pty(Telnet telnet, char *buf, int len);
28
29/*
30 * Process Telnet protocol data received from the network.
31 */
32void telnet_from_net(Telnet telnet, char *buf, int len);
33
34/*
35 * Return true if pre-shell-startup negotiations are complete and
36 * it's safe to start the shell subprocess now. On a true return,
37 * also fills in the shell_data structure.
38 */
39int telnet_shell_ok(Telnet telnet, struct shell_data *shdata);
40
41#endif /* FIXME_TELNET_H */