summaryrefslogtreecommitdiffstats
path: root/mbbsd/telnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/telnet.c')
-rw-r--r--mbbsd/telnet.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c
index 45f000a7..f348f08c 100644
--- a/mbbsd/telnet.c
+++ b/mbbsd/telnet.c
@@ -6,14 +6,21 @@ static char raw_connection = 0;
#ifdef DETECT_CLIENT
extern void UpdateClientCode(unsigned char c);
-void telnet_cb_update_client_code(void *ccctx, unsigned char c)
+static void
+telnet_cb_update_client_code(void *cc_arg, unsigned char c)
{
UpdateClientCode(c);
}
#endif
+static void
+telnet_cb_resize_term(void *resize_arg, int w, int h)
+{
+ term_resize(w, h);
+}
+
const static struct TelnetCallback telnet_callback = {
- term_resize,
+ telnet_cb_resize_term,
#ifdef DETECT_CLIENT
telnet_cb_update_client_code,
#else
@@ -22,16 +29,17 @@ const static struct TelnetCallback telnet_callback = {
};
void
-telnet_init(void)
+telnet_init(int do_init_cmd)
{
int fd = 0;
TelnetCtx *ctx = &telnet_ctx;
raw_connection = 1;
telnet_ctx_init(ctx, &telnet_callback, fd);
#ifdef DETECT_CLIENT
- telnet_ctx_set_ccctx(ctx, (void*)1);
+ telnet_ctx_set_cc_arg(ctx, (void*)1);
#endif
- telnet_send_init_cmds(fd);
+ if (do_init_cmd)
+ telnet_send_init_cmds(fd);
}
/* tty_read
@@ -58,7 +66,7 @@ void
telnet_turnoff_client_detect(void)
{
TelnetCtx *ctx = &telnet_ctx;
- telnet_ctx_set_ccctx(ctx, NULL);
+ telnet_ctx_set_cc_arg(ctx, NULL);
}
// vim: sw=4