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.
12 #if defined(HAVE_PROTOTYPES)
14 Create a new client socket
15 returns (FILE *)NULL on error
17 FILE *Socket(char *host, int clientPort);
20 Get a string terminated by an '\n', delete any '\r' and the '\n'.
21 Pass it a valid socket, a buffer for the string, and
22 the length of the buffer (including the trailing \0)
23 returns 0 for success.
25 int SockGets(char *buf, int len, FILE *sockfp);
28 Write a chunk of bytes to the socket.
29 Returns 0 for success.
31 int SockWrite(char *buf, int len, FILE *sockfp);
34 Send formatted output to the socket, followed
36 Returns 0 for success.
38 #if defined(HAVE_STDARG_H)
39 int SockPrintf(FILE *sockfp, char *format, ...) ;
44 #endif /* defined(HAVE_PROTOTYPES) */