aboutsummaryrefslogtreecommitdiffstats
path: root/socket.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-11-06 04:03:49 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-11-06 04:03:49 +0000
commit238cf89924fe33f03ceea5e4997d2ba0776530d3 (patch)
tree7b31a64cb01e8c22fcbc5d02c4a60779f7bdc31a /socket.h
parentf7af7a861c301ac43600e2da965692233e877d4d (diff)
downloadfetchmail-238cf89924fe33f03ceea5e4997d2ba0776530d3.tar.gz
fetchmail-238cf89924fe33f03ceea5e4997d2ba0776530d3.tar.bz2
fetchmail-238cf89924fe33f03ceea5e4997d2ba0776530d3.zip
Back out the attempt to use stdio.
svn path=/trunk/; revision=488
Diffstat (limited to 'socket.h')
-rw-r--r--socket.h35
1 files changed, 5 insertions, 30 deletions
diff --git a/socket.h b/socket.h
index 4473f0c0..31689aa0 100644
--- a/socket.h
+++ b/socket.h
@@ -9,20 +9,12 @@
#ifndef SOCKET__
#define SOCKET__
-#ifndef INADDR_NONE
-#ifdef INADDR_BROADCAST
-#define INADDR_NONE INADDR_BROADCAST
-#else
-#define INADDR_NONE -1
-#endif
-#endif
-
#if defined(HAVE_PROTOTYPES)
/*
Create a new client socket
-returns < 0 on error
+returns (FILE *)NULL on error
*/
-int Socket(char *host, int clientPort);
+FILE *Socket(char *host, int clientPort);
/*
Get a string terminated by an '\n', delete any '\r' and the '\n'.
@@ -30,25 +22,13 @@ Pass it a valid socket, a buffer for the string, and
the length of the buffer (including the trailing \0)
returns 0 for success.
*/
-int SockGets(int socket, char *buf, int len);
-
-/*
-Send a nul terminated string to the socket, followed by
-a CR-LF. Returns 0 for success.
-*/
-int SockPuts(int socket, char *buf);
+int SockGets(char *buf, int len, FILE *sockfp);
/*
Write a chunk of bytes to the socket.
Returns 0 for success.
*/
-int SockWrite(int socket, char *buf, int len);
-
-/*
-Read a chunk of bytes from the socket.
-Returns 0 for success.
-*/
-int SockRead(int socket, char *buf, int len);
+int SockWrite(char *buf, int len, FILE *sockfp);
/*
Send formatted output to the socket, followed
@@ -56,15 +36,10 @@ by a CR-LF.
Returns 0 for success.
*/
#if defined(HAVE_STDARG_H)
-int SockPrintf(int socket, char *format, ...) ;
+int SockPrintf(FILE *sockfp, char *format, ...) ;
#else
int SockPrintf();
#endif
-/*
-Check socket for readability. return 0 for not readable,
->0 for readable.
-*/
-int SockStatus(int socket, int seconds);
#endif /* defined(HAVE_PROTOTYPES) */