2 * socket.h -- declarations for socket library functions
4 * For license terms, see the file COPYING in this directory.
10 /* Create a new client socket; returns (FILE *)NULL on error */
11 FILE *SockOpen(char *host, int clientPort);
14 Get a string terminated by an '\n' (matches interface of fgets).
15 Pass it a valid socket, a buffer for the string, and
16 the length of the buffer (including the trailing \0)
17 returns buffer on success, NULL on failure.
19 char *SockGets(char *buf, int len, FILE *sockfp);
22 Write a chunk of bytes to the socket (matches interface of fwrite).
23 Returns number of bytes successfully written.
25 int SockWrite(char *buf, int size, int nels, FILE *sockfp);
28 Send formatted output to the socket (matches interface of fprintf).
29 Returns number of bytes successfully written.
31 #if defined(HAVE_STDARG_H)
32 int SockPrintf(FILE *sockfp, char *format, ...) ;