less(1): Regenerate defines.h and update Makefile
[dragonfly.git] / contrib / cvs-1.12 / src / socket-client.h
blob793b1da595ba2e80f53bb03951da221e58fd530e
1 /* CVS socket client stuff.
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.
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. */
13 #ifndef SOCKET_CLIENT_H__
14 #define SOCKET_CLIENT_H__ 1
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
23 struct buffer *socket_buffer_initialize
24 (int, int, void (*) (struct buffer *));
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
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
40 # include <string.h>
41 # ifndef strerror
42 extern char *strerror (int);
43 # endif
44 #endif /* ! SOCK_STRERROR */
46 #endif /* SOCKET_CLIENT_H__ */