42 lines
1.4 KiB
Raw Normal View History

2009-10-24 21:53:12 +00:00
.TH telnet_init 3 LIBTELNET "" "TELNET Library"
\fBtelnet_init\fP - initialize a new TELNET connection processor
\fB#include <libtelnet.h>\fP
.B "telnet_t *telnet_init( const telnet_telopt_t *\fItelopts\fP, telnet_event_handler_t \fIeh\fP, unsigned char \fIflags\fP, void *\fIuser_data\fP );"
The \fBtelnet_init\fP function initializes a new TELNET connection processor
and returns a pointer to the state tracker.
The parameter \fItelopts\fP is an array of telnet_telopt_t structures, which
defines the list of TELNET options your application supports. This array must
include a final entry with all structure element set to 0 to indicate the end
of the array.
The parameter \fIeh\fP is a pointer to a function to handle all events
generated by the TELNET processor.
The parameter \fIflags\fP is a set of flags controlling libtelnet's behavior.
The paramater \fIuser_data\fP is an opaque pointer that will be passed to
the \fIeh\fP function when called.
The return value is a pointer to the libtelnet state tracker, which must be
passed to all other libtelnet functions regarding this connection. If
\fBtelnet_init\fP fails for any reason, it will return NULL instead.
This value must be passed to \fBtelnet_free\fP after the connection is closed
to free resources used internally by libtelnet.
\fBlibtelnet\fR(3), \fBtelnet_free\fR(3)