Mercurial > hg > octave-nkf > gnulib-hg
annotate lib/inet_ntop.h @ 9268:a553c18c572d
Rename sys_time_.h to sys_time.in.h.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 02 Oct 2007 00:37:40 +0200 |
parents | 9f7f0714a40a |
children |
rev | line source |
---|---|
5825 | 1 /* Convert internet address from internal to printable, presentable format. |
6573
d6fe320d0a0d
Fix inet_ntop on mingw32.
Simon Josefsson <simon@josefsson.org>
parents:
6445
diff
changeset
|
2 Copyright (C) 2005, 2006 Free Software Foundation, Inc. |
5825 | 3 |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; if not, write to the Free Software Foundation, | |
5848
a48fb0e98c8c
*** empty log message ***
Paul Eggert <eggert@cs.ucla.edu>
parents:
5825
diff
changeset
|
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
5825 | 17 |
18 #include <sys/types.h> | |
6573
d6fe320d0a0d
Fix inet_ntop on mingw32.
Simon Josefsson <simon@josefsson.org>
parents:
6445
diff
changeset
|
19 #include <sys/socket.h> |
7064
9f7f0714a40a
Use netinet_in module.
Simon Josefsson <simon@josefsson.org>
parents:
7062
diff
changeset
|
20 #include <netinet/in.h> |
7062
532bc2e00710
Use arpa_inet in inet_?to?.
Simon Josefsson <simon@josefsson.org>
parents:
7060
diff
changeset
|
21 #include <arpa/inet.h> |
5825 | 22 |
23 /* Converts an internet address from internal format to a printable, | |
24 presentable format. | |
25 AF is an internet address family, such as AF_INET or AF_INET6. | |
26 SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr' | |
27 (for AF_INET6). | |
28 DST points to a buffer having room for CNT bytes. | |
29 The printable representation of the address (in numeric form, not | |
30 surrounded by [...], no reverse DNS is done) is placed in DST, and | |
31 DST is returned. If an error occurs, the return value is NULL and | |
32 errno is set. If CNT bytes are not sufficient to hold the result, | |
33 the return value is NULL and errno is set to ENOSPC. A good value | |
5979
5cc92ab8ce76
Use shortcut links to the POSIX specification.
Bruno Haible <bruno@clisp.org>
parents:
5848
diff
changeset
|
34 for CNT is 46. |
5cc92ab8ce76
Use shortcut links to the POSIX specification.
Bruno Haible <bruno@clisp.org>
parents:
5848
diff
changeset
|
35 |
5cc92ab8ce76
Use shortcut links to the POSIX specification.
Bruno Haible <bruno@clisp.org>
parents:
5848
diff
changeset
|
36 For more details, see the POSIX:2001 specification |
5cc92ab8ce76
Use shortcut links to the POSIX specification.
Bruno Haible <bruno@clisp.org>
parents:
5848
diff
changeset
|
37 <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */ |
5825 | 38 |
6445
87f075c0178d
* inet_ntop.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
Simon Josefsson <simon@josefsson.org>
parents:
6435
diff
changeset
|
39 #if !HAVE_DECL_INET_NTOP |
6435
be00741570b7
Fix inet_ntop on mingw32.
Simon Josefsson <simon@josefsson.org>
parents:
5979
diff
changeset
|
40 extern const char *inet_ntop (int af, const void *restrict src, |
be00741570b7
Fix inet_ntop on mingw32.
Simon Josefsson <simon@josefsson.org>
parents:
5979
diff
changeset
|
41 char *restrict dst, socklen_t cnt); |
5825 | 42 #endif |