summaryrefslogtreecommitdiffstats
path: root/include/cmsys.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cmsys.h')
-rw-r--r--include/cmsys.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/cmsys.h b/include/cmsys.h
index 863aab3f..6ae2119f 100644
--- a/include/cmsys.h
+++ b/include/cmsys.h
@@ -178,6 +178,7 @@ extern int Vector_search(const struct Vector *self, const char *name);
/* telnet.c */
struct TelnetCallback {
+ void (*write_data) (void *write_arg, int fd, const void *buf, size_t nbytes);
void (*term_resize) (void *resize_arg, int w, int h);
void (*update_client_code) (void *cc_arg, unsigned char seq);
};
@@ -197,16 +198,22 @@ struct TelnetCtx {
const struct TelnetCallback *callback;
// callback parameters
+ void *write_arg; // write_data
void *resize_arg; // term_resize
void *cc_arg; // update_client_code
};
typedef struct TelnetCtx TelnetCtx;
-extern TelnetCtx *telnet_create_contex(void);
-extern void telnet_ctx_init(TelnetCtx *ctx, const struct TelnetCallback *callback, int fd);
-extern void telnet_ctx_set_cc_arg(TelnetCtx *ctx, void *cc_arg);
+extern TelnetCtx *telnet_create_context(void);
+extern void telnet_free_context (TelnetCtx *ctx);
-extern void telnet_send_init_cmds(int fd);
-extern ssize_t telnet_process(TelnetCtx *ctx, unsigned char *buf, ssize_t size);
+extern void telnet_ctx_init (TelnetCtx *ctx, const struct TelnetCallback *callback, int fd);
+extern void telnet_ctx_send_init_cmds(TelnetCtx *ctx);
+
+extern void telnet_ctx_set_cc_arg (TelnetCtx *ctx, void *cc_arg);
+extern void telnet_ctx_set_write_arg (TelnetCtx *ctx, void *cc_arg);
+extern void telnet_ctx_set_resize_arg(TelnetCtx *ctx, void *cc_arg);
+
+extern ssize_t telnet_process (TelnetCtx *ctx, unsigned char *buf, ssize_t size);
#endif