Merge from vendor branch BIND:
[dragonfly.git] / contrib / cvs-1.12 / src / socket-client.h
1 /* CVS socket client stuff.
2
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; either version 2, or (at your option)
6    any later version.
7
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.  */
12
13 #ifndef SOCKET_CLIENT_H__
14 #define SOCKET_CLIENT_H__ 1
15
16 #if defined SOCK_ERRNO || defined SOCK_STRERROR
17 # include <sys/socket.h>
18 # include <netinet/in.h>
19 # include <arpa/inet.h>
20 # include <netdb.h>
21 #endif
22
23 struct buffer *socket_buffer_initialize
24   (int, int, void (*) (struct buffer *));
25
26 /* If SOCK_ERRNO is defined, then send()/recv() and other socket calls
27    do not set errno, but that this macro should be used to obtain an
28    error code.  This probably doesn't make sense unless
29    NO_SOCKET_TO_FD is also defined. */
30 #ifndef SOCK_ERRNO
31 # define SOCK_ERRNO errno
32 #endif
33
34 /* If SOCK_STRERROR is defined, then the error codes returned by
35    socket operations are not known to strerror, and this macro must be
36    used instead to convert those error codes to strings. */
37 #ifndef SOCK_STRERROR
38 # define SOCK_STRERROR strerror
39
40 # include <string.h>
41 # ifndef strerror
42 extern char *strerror (int);
43 # endif
44 #endif /* ! SOCK_STRERROR */
45
46 #endif /* SOCKET_CLIENT_H__ */