summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/cmsys.h18
-rw-r--r--include/proto.h2
2 files changed, 11 insertions, 9 deletions
diff --git a/include/cmsys.h b/include/cmsys.h
index 833dc7aa..040f1995 100644
--- a/include/cmsys.h
+++ b/include/cmsys.h
@@ -70,7 +70,6 @@ extern int file_exist_record(const char *file, const char *key);
extern int file_find_record(const char *file, const char *key);
extern int file_delete_record(const char *file, const char *key, int case_sensitive);
-
/* lock.c */
extern void PttLock(int fd, int start, int size, int mode);
@@ -81,6 +80,8 @@ extern int tobindex (const char *addr, int qlen, int (*setsock)(int), int do_lis
extern int toconnect(const char *addr);
extern int toread (int fd, void *buf, int len);
extern int towrite (int fd, const void *buf, int len);
+extern int send_remote_fd(int tunnel, int fd);
+extern int recv_remote_fd(int tunnel);
/* sort.c */
extern int cmp_int(const void *a, const void *b);
@@ -175,14 +176,12 @@ extern void Vector_sublist(const struct Vector *src, struct Vector *dst, const c
extern int Vector_remove(struct Vector *self, const char *name);
extern int Vector_search(const struct Vector *self, const char *name);
-extern int send_remote_fd(int tunnel, int fd);
-extern int recv_remote_fd(int tunnel);
-
/* telnet.c */
struct TelnetCallback {
- void (*term_resize)(int w, int h);
- void (*update_client_code)(void *ccctx, unsigned char seq);
+ void (*term_resize) (void *resize_arg, int w, int h);
+ void (*update_client_code) (void *cc_arg, unsigned char seq);
};
+
#define TELNET_IAC_MAXLEN (16)
struct TelnetCtx {
@@ -196,13 +195,16 @@ struct TelnetCtx {
unsigned int iac_buflen;
const struct TelnetCallback *callback;
- void *ccctx; // client code detection contex
+
+ // callback parameters
+ 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_ccctx(TelnetCtx *ctx, void *ccctx);
+extern void telnet_ctx_set_cc_arg(TelnetCtx *ctx, void *cc_arg);
extern void telnet_send_init_cmds(int fd);
extern ssize_t telnet_process(TelnetCtx *ctx, unsigned char *buf, size_t size);
diff --git a/include/proto.h b/include/proto.h
index 793c6a11..8add528e 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -420,7 +420,7 @@ int more(const char *fpath, int promptend);
/* piaip's new pager, pmore.c */
int pmore(const char *fpath, int promptend);
/* piaip's new telnet, telnet.c */
-extern void telnet_init(void);
+extern void telnet_init(int do_init_cmd);
extern ssize_t tty_read(unsigned char *buf, size_t max);
extern void telnet_turnoff_client_detect(void);