From 238cf89924fe33f03ceea5e4997d2ba0776530d3 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 6 Nov 1996 04:03:49 +0000 Subject: Back out the attempt to use stdio. svn path=/trunk/; revision=488 --- socket.h | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'socket.h') 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) */ -- cgit v1.2.3