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