xref: /dflybsd-src/contrib/cvs-1.12/src/socket-client.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /* CVS socket client stuff.
286d7f5d3SJohn Marino 
386d7f5d3SJohn Marino    This program is free software; you can redistribute it and/or modify
486d7f5d3SJohn Marino    it under the terms of the GNU General Public License as published by
586d7f5d3SJohn Marino    the Free Software Foundation; either version 2, or (at your option)
686d7f5d3SJohn Marino    any later version.
786d7f5d3SJohn Marino 
886d7f5d3SJohn Marino    This program is distributed in the hope that it will be useful,
986d7f5d3SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
1086d7f5d3SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1186d7f5d3SJohn Marino    GNU General Public License for more details.  */
1286d7f5d3SJohn Marino 
1386d7f5d3SJohn Marino #ifndef SOCKET_CLIENT_H__
1486d7f5d3SJohn Marino #define SOCKET_CLIENT_H__ 1
1586d7f5d3SJohn Marino 
1686d7f5d3SJohn Marino #if defined SOCK_ERRNO || defined SOCK_STRERROR
1786d7f5d3SJohn Marino # include <sys/socket.h>
1886d7f5d3SJohn Marino # include <netinet/in.h>
1986d7f5d3SJohn Marino # include <arpa/inet.h>
2086d7f5d3SJohn Marino # include <netdb.h>
2186d7f5d3SJohn Marino #endif
2286d7f5d3SJohn Marino 
2386d7f5d3SJohn Marino struct buffer *socket_buffer_initialize
2486d7f5d3SJohn Marino   (int, int, void (*) (struct buffer *));
2586d7f5d3SJohn Marino 
2686d7f5d3SJohn Marino /* If SOCK_ERRNO is defined, then send()/recv() and other socket calls
2786d7f5d3SJohn Marino    do not set errno, but that this macro should be used to obtain an
2886d7f5d3SJohn Marino    error code.  This probably doesn't make sense unless
2986d7f5d3SJohn Marino    NO_SOCKET_TO_FD is also defined. */
3086d7f5d3SJohn Marino #ifndef SOCK_ERRNO
3186d7f5d3SJohn Marino # define SOCK_ERRNO errno
3286d7f5d3SJohn Marino #endif
3386d7f5d3SJohn Marino 
3486d7f5d3SJohn Marino /* If SOCK_STRERROR is defined, then the error codes returned by
3586d7f5d3SJohn Marino    socket operations are not known to strerror, and this macro must be
3686d7f5d3SJohn Marino    used instead to convert those error codes to strings. */
3786d7f5d3SJohn Marino #ifndef SOCK_STRERROR
3886d7f5d3SJohn Marino # define SOCK_STRERROR strerror
3986d7f5d3SJohn Marino 
4086d7f5d3SJohn Marino # include <string.h>
4186d7f5d3SJohn Marino # ifndef strerror
4286d7f5d3SJohn Marino extern char *strerror (int);
4386d7f5d3SJohn Marino # endif
4486d7f5d3SJohn Marino #endif /* ! SOCK_STRERROR */
4586d7f5d3SJohn Marino 
4686d7f5d3SJohn Marino #endif /* SOCKET_CLIENT_H__ */
47