diff options
author | Sean Middleditch <sean@middleditch.us> | 2009-09-19 14:35:48 -0700 |
---|---|---|
committer | Sean Middleditch <sean@middleditch.us> | 2009-09-19 14:35:48 -0700 |
commit | d2466a01b6929ac44d18001162510a2aee51c4fc (patch) | |
tree | 6478b1a174f973e15fe7efc6428fe41cd3a46eb5 /libtelnet.h | |
parent | d08d812c3025474d47a090626b8ee14fcb89f883 (diff) |
make libtelnet_t private; libtelnet_init now returns a pointer instead of taking one, and libtelnet_free frees the pointer passed in
Diffstat (limited to 'libtelnet.h')
-rw-r--r-- | libtelnet.h | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/libtelnet.h b/libtelnet.h index 69eb864..84f48ff 100644 --- a/libtelnet.h +++ b/libtelnet.h @@ -186,38 +186,11 @@ struct telnet_telopt_t { unsigned char him; /* TELNET_DO or TELNET_DONT */ }; -/* state tracker */ -struct telnet_t { - /* user data */ - void *ud; - /* telopt support table */ - const telnet_telopt_t *telopts; - /* event handler */ - telnet_event_handler_t eh; -#ifdef HAVE_ZLIB - /* zlib (mccp2) compression */ - z_stream *z; -#endif - /* RFC1143 option negotiation states */ - struct telnet_rfc1143_t *q; - /* sub-request buffer */ - char *buffer; - /* current size of the buffer */ - size_t buffer_size; - /* current buffer write position (also length of buffer data) */ - size_t buffer_pos; - /* current state */ - enum telnet_state_t state; - /* option flags */ - unsigned char flags; - /* current subnegotiation telopt */ - unsigned char sb_telopt; - /* length of RFC1143 queue */ - unsigned char q_size; -}; +/* state tracker -- private data structure */ +struct telnet_t; /* initialize a telnet state tracker */ -extern void telnet_init(telnet_t *telnet, const telnet_telopt_t *telopts, +extern telnet_t* telnet_init(const telnet_telopt_t *telopts, telnet_event_handler_t eh, unsigned char flags, void *user_data); /* free up any memory allocated by a state tracker */ |