39 lines
773 B
C
39 lines
773 B
C
/*
|
|
|
|
HELPER.H
|
|
========
|
|
(c) Paul Griffiths, 1999
|
|
Email: paulgriffiths@cwcom.net
|
|
|
|
Interface to socket helper functions.
|
|
|
|
Many of these functions are adapted from, inspired by, or
|
|
otherwise shamelessly plagiarised from "Unix Network
|
|
Programming", W Richard Stevens (Prentice Hall).
|
|
|
|
*/
|
|
|
|
|
|
#ifndef PG_SOCK_HELP
|
|
#define PG_SOCK_HELP
|
|
|
|
|
|
#include <unistd.h> /* for ssize_t data type */
|
|
|
|
/* Global constants */
|
|
#define PORT (8080)
|
|
#define MAX_LINE (1023)
|
|
#define LOCALHOST "127.0.0.1"
|
|
|
|
struct _Server {
|
|
int sdata;
|
|
};
|
|
typedef struct _Server Server;
|
|
|
|
|
|
/* Function declarations */
|
|
|
|
ssize_t Readline(int fd, void *vptr, size_t maxlen);
|
|
ssize_t Writeline(int fc, const void *vptr, size_t maxlen);
|
|
#endif /* PG_SOCK_HELP */
|