client.h 633 Bytes
#ifndef __CLIENT_H__
#define __CLIENT_H__

#include <stdio.h> /* for FILE */

#define READBUFSIZE    2048   /* Size of receive buffer */
#define CLIENTMULTMAX  512U   /* 1MB maximum size the readbuffer may grow */

#define WRITE_ERR_IO        -1
#define WRITE_ERR_NOPRINT   -2

#define READ_ERR_LONGLINE   -2

typedef struct {
    int          socket;
    char *       buffer;
    unsigned int readPos;
    unsigned int bufMult;
    char         remoteAddr[16];
} tClient;


void clientClose(tClient *);
int  clientRead(tClient *);
int  writeRemaining(tClient *, FILE *);
int  writeBuffer(tClient *, FILE *);

#endif // __CLIENT_H__