annotate lib/socket_.h @ 7017:005fe24b840a

Update javaexec module from GNU gettext 0.15.
author Bruno Haible <bruno@clisp.org>
date Sat, 22 Jul 2006 15:17:55 +0000
parents 9c5fd9877469
children 76f9d13945cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6853
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
1 /* Provide a sys/socket header file for systems lacking it (read: MinGW).
6536
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
2 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
3 Written by Simon Josefsson.
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
4
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
8 any later version.
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
9
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
13 GNU General Public License for more details.
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
14
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
16 along with this program; if not, write to the Free Software Foundation,
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
18
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
19 #ifndef _SYS_SOCKET_H
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
20 #define _SYS_SOCKET_H
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
21
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
22 /* This file is supposed to be used on platforms that lack
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
23 sys/socket.h. It is intended to provide definitions and prototypes
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
24 needed by an application.
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
25
6853
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
26 Currently only MinGW is supported. See the gnulib manual regarding
6857
Simon Josefsson <simon@josefsson.org>
parents: 6853
diff changeset
27 Windows sockets. MinGW has the header files winsock2.h and
6853
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
28 ws2tcpip.h that declare the sys/socket.h definitions we need. Note
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
29 that you can influence which definitions you get by setting the
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
30 WINVER symbol before including these two files. For example,
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
31 getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
32 symbol is set indiriectly through WINVER). You can set this by
6857
Simon Josefsson <simon@josefsson.org>
parents: 6853
diff changeset
33 adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
6853
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
34 code may not run on older Windows releases then. My Windows 2000
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
35 box was not able to run the code, for example. The situation is
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
36 slightly confusing because:
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
37 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
38 suggests that getaddrinfo should be available on all Windows
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
39 releases. */
d63e1000901c 2006-06-21 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6619
diff changeset
40
6536
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
41
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
42 #if HAVE_WINSOCK2_H
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
43 # include <winsock2.h>
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
44 #endif
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
45 #if HAVE_WS2TCPIP_H
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
46 # include <ws2tcpip.h>
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
47 #endif
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
48
6571
f7945ef945d6 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents: 6536
diff changeset
49 /* For shutdown(). */
6589
60dfc5a7a541 Remove useless parentheses in uses of cpp `defined'.
Jim Meyering <jim@meyering.net>
parents: 6588
diff changeset
50 #if !defined SHUT_RD && defined SD_RECEIVE
6571
f7945ef945d6 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents: 6536
diff changeset
51 # define SHUT_RD SD_RECEIVE
f7945ef945d6 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents: 6536
diff changeset
52 #endif
6589
60dfc5a7a541 Remove useless parentheses in uses of cpp `defined'.
Jim Meyering <jim@meyering.net>
parents: 6588
diff changeset
53 #if !defined SHUT_WR && defined SD_SEND
6588
fbe98790fd68 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 6571
diff changeset
54 # define SHUT_WR SD_SEND
6571
f7945ef945d6 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents: 6536
diff changeset
55 #endif
6589
60dfc5a7a541 Remove useless parentheses in uses of cpp `defined'.
Jim Meyering <jim@meyering.net>
parents: 6588
diff changeset
56 #if !defined SHUT_RDWR && defined SD_BOTH
6588
fbe98790fd68 * socket_.h (SHUT_WR, SHUT_RDWR): Don't hardcode, suggested by Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 6571
diff changeset
57 # define SHUT_RDWR SD_BOTH
6571
f7945ef945d6 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents: 6536
diff changeset
58 #endif
f7945ef945d6 * socket_.h: Map SHUT_RD, SHUT_WR, SHUT_RDWR correctly.
Simon Josefsson <simon@josefsson.org>
parents: 6536
diff changeset
59
6536
169ab032c734 Add sys_socket module.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
60 #endif /* _SYS_SOCKET_H */