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

readline.c File Reference

The readline implementation. More...

#include "config.h"
#include "defines.h"
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#include "readline.h"

Go to the source code of this file.

Functions

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


Detailed Description

The readline implementation.

This file contains a thread safe version of the readline algorithm.

Definition in file readline.c.


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