|author||Sean Middleditch <firstname.lastname@example.org>||2009-09-19 14:39:58 -0700|
|committer||Sean Middleditch <email@example.com>||2009-09-19 14:39:58 -0700|
2 files changed, 20 insertions, 9 deletions
@@ -1,3 +1,10 @@
+* added pkg-config file
+* telnet_t is now a private data structure
+* telnet_init() allocates memory and returns a pointer
@@ -91,13 +91,13 @@ IIa. Initialization
all connections if you support a fixed set of options. Most
applications will support only a fixed set of options.
- void telnet_init(telnet_t *telnet, const telnet_telopts_t *telopts,
+ telnet_t *telnet_init(const telnet_telopts_t *telopts,
telnet_event_handler_t handler, unsigned char flags,
- The telnet_init() function is responsible for initializing the
- data in a telnet_t structure. It must be called immediately after
- establishing a connection and before any other libtelnet API calls
- are made.
+ The telnet_init() function is responsible for allocating memory
+ and initializing the data in a telnet_t structure. It must be
+ called immediately after establishing a connection and before any
+ other libtelnet API calls are made.
The telopts field is the telopt support table as described above.
@@ -116,11 +116,15 @@ IIa. Initialization
Operate in proxy mode. This disables the RFC1143 support and
enables automatic detection of COMPRESS2 streams.
+ If telnet_init() fails to allocate the required memory, the
+ returned pointer will be zero.
- boid telnet_free(telnet_t *telnet);
- Releases any internal memory allocated by libtelnet. This must be
- called whenever a connection is closed, or you will incur memory
+ void telnet_free(telnet_t *telnet);
+ Releases any internal memory allocated by libtelnet for the given
+ telnet pointer. This must be called whenever a connection is
+ closed, or you will incur memory leaks. The pointer passed in may
+ no longer be used afterwards.
IIb. Receiving Data