2 * socket.h -- declarations for socket library functions
4 * Design and implementation by Carl Harris <ceharris@mal.com>
6 * For license terms, see the file COPYING in this directory.
13 Create a new client socket
14 returns (FILE *)NULL on error
16 FILE *Socket(char *host, int clientPort);
19 Get a string terminated by an '\n', delete any '\r' and the '\n'.
20 Pass it a valid socket, a buffer for the string, and
21 the length of the buffer (including the trailing \0)
22 returns 0 for success.
24 int SockGets(char *buf, int len, FILE *sockfp);
26 /* Ship a character array to the socket */
27 #define SockWrite(buf, len, sockfp) fwrite(buf, 1, len, sockfp)
30 Send formatted output to the socket, followed
31 by a CR-LF. Returns 0 for success.
33 #define SockPrintf fprintf