]> Pileus Git - ~andy/fetchmail/blob - socket.h
Implement batchlimit option.
[~andy/fetchmail] / socket.h
1 /*
2  * socket.h -- declarations for socket library functions
3  *
4  * Design and implementation by Carl Harris <ceharris@mal.com>
5  *
6  * For license terms, see the file COPYING in this directory.
7  */
8
9 #ifndef SOCKET__
10 #define SOCKET__
11
12 #if defined(HAVE_PROTOTYPES)
13 /*
14 Create a new client socket 
15 returns (FILE *)NULL on error 
16 */
17 FILE *Socket(char *host, int clientPort);
18
19 /* 
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. 
24 */
25 int SockGets(char *buf, int len, FILE *sockfp);
26
27 /*
28 Write a chunk of bytes to the socket.
29 Returns 0 for success.
30 */
31 int SockWrite(char *buf, int len, FILE *sockfp);
32
33 /* 
34 Send formatted output to the socket, followed
35 by a CR-LF.
36 Returns 0 for success.
37 */
38 #if defined(HAVE_STDARG_H)
39 int SockPrintf(FILE *sockfp, char *format, ...) ;
40 #else
41 int SockPrintf();
42 #endif
43  
44 #endif /* defined(HAVE_PROTOTYPES) */
45
46 #endif /* SOCKET__ */