dhcpd-pools  2.28
ISC dhcpd lease usage analyser
inet.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A GNU-like <arpa/inet.h>.
3 
4  Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3, or (at your option)
9  any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, see <http://www.gnu.org/licenses/>. */
18 
19 #ifndef _GL_ARPA_INET_H
20 
21 #if __GNUC__ >= 3
22 #pragma GCC system_header
23 #endif
24 
25 
26 #if 1
27 # include <features.h> /* for __GLIBC__ */
28 #endif
29 
30 /* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and
31  for pulling in winsock2.h etc. under MinGW.
32  But avoid namespace pollution on glibc systems. */
33 #ifndef __GLIBC__
34 # include <sys/socket.h>
35 #endif
36 
37 /* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
38  But avoid namespace pollution on glibc systems. */
39 #if defined __TANDEM && !defined __GLIBC__
40 # include <netdb.h>
41 #endif
42 
43 #if 1
44 
45 /* The include_next requires a split double-inclusion guard. */
46 # include_next <arpa/inet.h>
47 
48 #endif
49 
50 #ifndef _GL_ARPA_INET_H
51 #define _GL_ARPA_INET_H
52 
53 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
54 #ifndef _GL_CXXDEFS_H
55 #define _GL_CXXDEFS_H
56 
57 /* The three most frequent use cases of these macros are:
58 
59  * For providing a substitute for a function that is missing on some
60  platforms, but is declared and works fine on the platforms on which
61  it exists:
62 
63  #if @GNULIB_FOO@
64  # if !@HAVE_FOO@
65  _GL_FUNCDECL_SYS (foo, ...);
66  # endif
67  _GL_CXXALIAS_SYS (foo, ...);
68  _GL_CXXALIASWARN (foo);
69  #elif defined GNULIB_POSIXCHECK
70  ...
71  #endif
72 
73  * For providing a replacement for a function that exists on all platforms,
74  but is broken/insufficient and needs to be replaced on some platforms:
75 
76  #if @GNULIB_FOO@
77  # if @REPLACE_FOO@
78  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
79  # undef foo
80  # define foo rpl_foo
81  # endif
82  _GL_FUNCDECL_RPL (foo, ...);
83  _GL_CXXALIAS_RPL (foo, ...);
84  # else
85  _GL_CXXALIAS_SYS (foo, ...);
86  # endif
87  _GL_CXXALIASWARN (foo);
88  #elif defined GNULIB_POSIXCHECK
89  ...
90  #endif
91 
92  * For providing a replacement for a function that exists on some platforms
93  but is broken/insufficient and needs to be replaced on some of them and
94  is additionally either missing or undeclared on some other platforms:
95 
96  #if @GNULIB_FOO@
97  # if @REPLACE_FOO@
98  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
99  # undef foo
100  # define foo rpl_foo
101  # endif
102  _GL_FUNCDECL_RPL (foo, ...);
103  _GL_CXXALIAS_RPL (foo, ...);
104  # else
105  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
106  _GL_FUNCDECL_SYS (foo, ...);
107  # endif
108  _GL_CXXALIAS_SYS (foo, ...);
109  # endif
110  _GL_CXXALIASWARN (foo);
111  #elif defined GNULIB_POSIXCHECK
112  ...
113  #endif
114 */
115 
116 /* _GL_EXTERN_C declaration;
117  performs the declaration with C linkage. */
118 #if defined __cplusplus
119 # define _GL_EXTERN_C extern "C"
120 #else
121 # define _GL_EXTERN_C extern
122 #endif
123 
124 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
125  declares a replacement function, named rpl_func, with the given prototype,
126  consisting of return type, parameters, and attributes.
127  Example:
128  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
129  _GL_ARG_NONNULL ((1)));
130  */
131 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
132  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
133 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
134  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
135 
136 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
137  declares the system function, named func, with the given prototype,
138  consisting of return type, parameters, and attributes.
139  Example:
140  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
141  _GL_ARG_NONNULL ((1)));
142  */
143 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
144  _GL_EXTERN_C rettype func parameters_and_attributes
145 
146 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
147  declares a C++ alias called GNULIB_NAMESPACE::func
148  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
149  Example:
150  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
151  */
152 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
153  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
154 #if defined __cplusplus && defined GNULIB_NAMESPACE
155 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
156  namespace GNULIB_NAMESPACE \
157  { \
158  rettype (*const func) parameters = ::rpl_func; \
159  } \
160  _GL_EXTERN_C int _gl_cxxalias_dummy
161 #else
162 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
163  _GL_EXTERN_C int _gl_cxxalias_dummy
164 #endif
165 
166 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
167  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
168  except that the C function rpl_func may have a slightly different
169  declaration. A cast is used to silence the "invalid conversion" error
170  that would otherwise occur. */
171 #if defined __cplusplus && defined GNULIB_NAMESPACE
172 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
173  namespace GNULIB_NAMESPACE \
174  { \
175  rettype (*const func) parameters = \
176  reinterpret_cast<rettype(*)parameters>(::rpl_func); \
177  } \
178  _GL_EXTERN_C int _gl_cxxalias_dummy
179 #else
180 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
181  _GL_EXTERN_C int _gl_cxxalias_dummy
182 #endif
183 
184 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
185  declares a C++ alias called GNULIB_NAMESPACE::func
186  that redirects to the system provided function func, if GNULIB_NAMESPACE
187  is defined.
188  Example:
189  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
190  */
191 #if defined __cplusplus && defined GNULIB_NAMESPACE
192  /* If we were to write
193  rettype (*const func) parameters = ::func;
194  like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
195  better (remove an indirection through a 'static' pointer variable),
196  but then the _GL_CXXALIASWARN macro below would cause a warning not only
197  for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
198 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
199  namespace GNULIB_NAMESPACE \
200  { \
201  static rettype (*func) parameters = ::func; \
202  } \
203  _GL_EXTERN_C int _gl_cxxalias_dummy
204 #else
205 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
206  _GL_EXTERN_C int _gl_cxxalias_dummy
207 #endif
208 
209 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
210  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
211  except that the C function func may have a slightly different declaration.
212  A cast is used to silence the "invalid conversion" error that would
213  otherwise occur. */
214 #if defined __cplusplus && defined GNULIB_NAMESPACE
215 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
216  namespace GNULIB_NAMESPACE \
217  { \
218  static rettype (*func) parameters = \
219  reinterpret_cast<rettype(*)parameters>(::func); \
220  } \
221  _GL_EXTERN_C int _gl_cxxalias_dummy
222 #else
223 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
224  _GL_EXTERN_C int _gl_cxxalias_dummy
225 #endif
226 
227 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
228  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
229  except that the C function is picked among a set of overloaded functions,
230  namely the one with rettype2 and parameters2. Two consecutive casts
231  are used to silence the "cannot find a match" and "invalid conversion"
232  errors that would otherwise occur. */
233 #if defined __cplusplus && defined GNULIB_NAMESPACE
234  /* The outer cast must be a reinterpret_cast.
235  The inner cast: When the function is defined as a set of overloaded
236  functions, it works as a static_cast<>, choosing the designated variant.
237  When the function is defined as a single variant, it works as a
238  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
239 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
240  namespace GNULIB_NAMESPACE \
241  { \
242  static rettype (*func) parameters = \
243  reinterpret_cast<rettype(*)parameters>( \
244  (rettype2(*)parameters2)(::func)); \
245  } \
246  _GL_EXTERN_C int _gl_cxxalias_dummy
247 #else
248 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
249  _GL_EXTERN_C int _gl_cxxalias_dummy
250 #endif
251 
252 /* _GL_CXXALIASWARN (func);
253  causes a warning to be emitted when ::func is used but not when
254  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
255  variants. */
256 #if defined __cplusplus && defined GNULIB_NAMESPACE
257 # define _GL_CXXALIASWARN(func) \
258  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
259 # define _GL_CXXALIASWARN_1(func,namespace) \
260  _GL_CXXALIASWARN_2 (func, namespace)
261 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
262  we enable the warning only when not optimizing. */
263 # if !__OPTIMIZE__
264 # define _GL_CXXALIASWARN_2(func,namespace) \
265  _GL_WARN_ON_USE (func, \
266  "The symbol ::" #func " refers to the system function. " \
267  "Use " #namespace "::" #func " instead.")
268 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
269 # define _GL_CXXALIASWARN_2(func,namespace) \
270  extern __typeof__ (func) func
271 # else
272 # define _GL_CXXALIASWARN_2(func,namespace) \
273  _GL_EXTERN_C int _gl_cxxalias_dummy
274 # endif
275 #else
276 # define _GL_CXXALIASWARN(func) \
277  _GL_EXTERN_C int _gl_cxxalias_dummy
278 #endif
279 
280 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
281  causes a warning to be emitted when the given overloaded variant of ::func
282  is used but not when GNULIB_NAMESPACE::func is used. */
283 #if defined __cplusplus && defined GNULIB_NAMESPACE
284 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
285  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
286  GNULIB_NAMESPACE)
287 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
288  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
289 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
290  we enable the warning only when not optimizing. */
291 # if !__OPTIMIZE__
292 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
293  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
294  "The symbol ::" #func " refers to the system function. " \
295  "Use " #namespace "::" #func " instead.")
296 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
297 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
298  extern __typeof__ (func) func
299 # else
300 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
301  _GL_EXTERN_C int _gl_cxxalias_dummy
302 # endif
303 #else
304 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
305  _GL_EXTERN_C int _gl_cxxalias_dummy
306 #endif
307 
308 #endif /* _GL_CXXDEFS_H */
309 
310 /* The definition of _GL_ARG_NONNULL is copied here. */
311 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
312  that the values passed as arguments n, ..., m must be non-NULL pointers.
313  n = 1 stands for the first argument, n = 2 for the second argument etc. */
314 #ifndef _GL_ARG_NONNULL
315 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
316 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
317 # else
318 # define _GL_ARG_NONNULL(params)
319 # endif
320 #endif
321 
322 /* The definition of _GL_WARN_ON_USE is copied here. */
323 #ifndef _GL_WARN_ON_USE
324 
325 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
326 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
327 # define _GL_WARN_ON_USE(function, message) \
328 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
329 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
330 /* Verify the existence of the function. */
331 # define _GL_WARN_ON_USE(function, message) \
332 extern __typeof__ (function) function
333 # else /* Unsupported. */
334 # define _GL_WARN_ON_USE(function, message) \
335 _GL_WARN_EXTERN_C int _gl_warn_on_use
336 # endif
337 #endif
338 
339 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
340  is like _GL_WARN_ON_USE (function, "string"), except that the function is
341  declared with the given prototype, consisting of return type, parameters,
342  and attributes.
343  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
344  not work in this case. */
345 #ifndef _GL_WARN_ON_USE_CXX
346 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
347 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
348 extern rettype function parameters_and_attributes \
349  __attribute__ ((__warning__ (msg)))
350 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
351 /* Verify the existence of the function. */
352 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
353 extern rettype function parameters_and_attributes
354 # else /* Unsupported. */
355 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
356 _GL_WARN_EXTERN_C int _gl_warn_on_use
357 # endif
358 #endif
359 
360 /* _GL_WARN_EXTERN_C declaration;
361  performs the declaration with C linkage. */
362 #ifndef _GL_WARN_EXTERN_C
363 # if defined __cplusplus
364 # define _GL_WARN_EXTERN_C extern "C"
365 # else
366 # define _GL_WARN_EXTERN_C extern
367 # endif
368 #endif
369 
370 
371 #if 0
372 /* Converts an internet address from internal format to a printable,
373  presentable format.
374  AF is an internet address family, such as AF_INET or AF_INET6.
375  SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
376  (for AF_INET6).
377  DST points to a buffer having room for CNT bytes.
378  The printable representation of the address (in numeric form, not
379  surrounded by [...], no reverse DNS is done) is placed in DST, and
380  DST is returned. If an error occurs, the return value is NULL and
381  errno is set. If CNT bytes are not sufficient to hold the result,
382  the return value is NULL and errno is set to ENOSPC. A good value
383  for CNT is 46.
384 
385  For more details, see the POSIX:2001 specification
386  <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
387 # if 0
388 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
389 # undef inet_ntop
390 # define inet_ntop rpl_inet_ntop
391 # endif
392 _GL_FUNCDECL_RPL (inet_ntop, const char *,
393  (int af, const void *restrict src,
394  char *restrict dst, socklen_t cnt)
395  _GL_ARG_NONNULL ((2, 3)));
396 _GL_CXXALIAS_RPL (inet_ntop, const char *,
397  (int af, const void *restrict src,
398  char *restrict dst, socklen_t cnt));
399 # else
400 # if !1
401 _GL_FUNCDECL_SYS (inet_ntop, const char *,
402  (int af, const void *restrict src,
403  char *restrict dst, socklen_t cnt)
404  _GL_ARG_NONNULL ((2, 3)));
405 # endif
406 /* Need to cast, because on NonStop Kernel, the fourth parameter is
407  size_t cnt. */
408 _GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
409  (int af, const void *restrict src,
410  char *restrict dst, socklen_t cnt));
411 # endif
412 _GL_CXXALIASWARN (inet_ntop);
413 #elif defined GNULIB_POSIXCHECK
414 # undef inet_ntop
415 # if HAVE_RAW_DECL_INET_NTOP
416 _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
417  "use gnulib module inet_ntop for portability");
418 # endif
419 #endif
420 
421 #if 1
422 # if 0
423 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
424 # undef inet_pton
425 # define inet_pton rpl_inet_pton
426 # endif
428  (int af, const char *restrict src, void *restrict dst)
429  _GL_ARG_NONNULL ((2, 3)));
431  (int af, const char *restrict src, void *restrict dst));
432 # else
433 # if !1
435  (int af, const char *restrict src, void *restrict dst)
436  _GL_ARG_NONNULL ((2, 3)));
437 # endif
439  (int af, const char *restrict src, void *restrict dst));
440 # endif
442 #elif defined GNULIB_POSIXCHECK
443 # undef inet_pton
444 # if HAVE_RAW_DECL_INET_PTON
445 _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
446  "use gnulib module inet_pton for portability");
447 # endif
448 #endif
449 
450 
451 #endif /* _GL_ARPA_INET_H */
452 #endif /* _GL_ARPA_INET_H */
int inet_pton(int af, const char *restrict src, void *restrict dst)
Definition: inet_pton.c:82
#define _GL_CXXALIAS_SYS_CAST(func, rettype, parameters)
Definition: inet.h:223
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: inet.h:143
#define _GL_ARG_NONNULL(params)
Definition: inet.h:318
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: inet.h:152
#define _GL_CXXALIASWARN(func)
Definition: inet.h:276
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: inet.h:205
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: inet.h:131
#define restrict
Definition: config.h:1761
#define _GL_WARN_ON_USE(function, message)
Definition: inet.h:334