Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

readline.h File Reference

the readline definitions More...

Go to the source code of this file.

Data Structures

struct  s_rline_t

Typedefs

typedef s_rline_t rline_t

Functions

u_char * readline (int fd, rline_t *tsd)
ssize_t writen (int fd, const void *vptr, size_t n)


Detailed Description

the readline definitions

Author:
Christian Kruse, <cjk@wwwtech.de>
This file includes the definitions for a thread-safe, buffered readline algorithm. It was originally developed by Richard Stevens, but I did some small changes.

Definition in file readline.h.


Typedef Documentation

typedef struct s_rline_t rline_t
 

This structure contains the necessary information about the read data


Function Documentation

u_char* readline int  fd,
rline_t tsd
 

This function reads a complete line from a socket and buffers the data which was not needed within this call.

Parameters:
fd The file descriptor to read from
tsd The buffer structure used to buffer
Returns:
The line as an u_char * string on success, NULL on failure.
Attention:
You have to free() the returned string!

Definition at line 78 of file readline.c.

ssize_t writen int  fd,
const void *  vptr,
size_t  n
 

This function tries to write n bytes to a file descriptor. It re-tries it on EAGAIN and EINTR. If not all of the data could be written in the first call, it makes more calls to write the rest of the data.

Parameters:
fd The filedescriptor to write to.
vptr The pointer to the data to write
n The size of the data to write
Returns:
The number of bytes written.

Definition at line 139 of file readline.c.


Generated on Sun Apr 25 16:37:39 2004 for Classic Forum by doxygen 1.3.5