dhcpd-pools  3.0
ISC dhcpd lease usage analyser
wctype.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
3 
4  Copyright (C) 2006-2017 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 <https://www.gnu.org/licenses/>. */
18 
19 /* Written by Bruno Haible and Paul Eggert. */
20 
21 /*
22  * ISO C 99 <wctype.h> for platforms that lack it.
23  * <http://www.opengroup.org/susv3xbd/wctype.h.html>
24  *
25  * iswctype, towctrans, towlower, towupper, wctrans, wctype,
26  * wctrans_t, and wctype_t are not yet implemented.
27  */
28 
29 #if __GNUC__ >= 3
30 #pragma GCC system_header
31 #endif
32 
33 
34 #if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
35 
36 /* Special invocation convention:
37  - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
38  <wctype.h> is being processed, which doesn't include the idempotency
39  guard. */
40 
41 #include_next <wctype.h>
42 
43 #else
44 /* Normal invocation convention. */
45 
46 #ifndef _GL_WCTYPE_H
47 
48 #if 1
49 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
50  Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
51  <wchar.h>.
52  BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
53  included before <wchar.h>. */
54 # include <stddef.h>
55 # include <stdio.h>
56 # include <time.h>
57 # include <wchar.h>
58 #endif
59 
60 /* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and
61  isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>. Include
62  <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
63  declarations. */
64 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
65 # include <ctype.h>
66 # include <wchar.h>
67 #endif
68 
69 /* Include the original <wctype.h> if it exists.
70  BeOS 5 has the functions but no <wctype.h>. */
71 /* The include_next requires a split double-inclusion guard. */
72 #if 1
73 # include_next <wctype.h>
74 #endif
75 
76 #ifndef _GL_WCTYPE_H
77 #define _GL_WCTYPE_H
78 
79 #ifndef _GL_INLINE_HEADER_BEGIN
80  #error "Please include config.h first."
81 #endif
83 #ifndef _GL_WCTYPE_INLINE
84 # define _GL_WCTYPE_INLINE _GL_INLINE
85 #endif
86 
87 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
88 /* C++ compatible function declaration macros.
89  Copyright (C) 2010-2017 Free Software Foundation, Inc.
90 
91  This program is free software: you can redistribute it and/or modify it
92  under the terms of the GNU General Public License as published
93  by the Free Software Foundation; either version 3 of the License, or
94  (at your option) any later version.
95 
96  This program is distributed in the hope that it will be useful,
97  but WITHOUT ANY WARRANTY; without even the implied warranty of
98  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
99  General Public License for more details.
100 
101  You should have received a copy of the GNU General Public License
102  along with this program. If not, see <https://www.gnu.org/licenses/>. */
103 
104 #ifndef _GL_CXXDEFS_H
105 #define _GL_CXXDEFS_H
106 
107 /* Begin/end the GNULIB_NAMESPACE namespace. */
108 #if defined __cplusplus && defined GNULIB_NAMESPACE
109 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
110 # define _GL_END_NAMESPACE }
111 #else
112 # define _GL_BEGIN_NAMESPACE
113 # define _GL_END_NAMESPACE
114 #endif
115 
116 /* The three most frequent use cases of these macros are:
117 
118  * For providing a substitute for a function that is missing on some
119  platforms, but is declared and works fine on the platforms on which
120  it exists:
121 
122  #if @GNULIB_FOO@
123  # if !@HAVE_FOO@
124  _GL_FUNCDECL_SYS (foo, ...);
125  # endif
126  _GL_CXXALIAS_SYS (foo, ...);
127  _GL_CXXALIASWARN (foo);
128  #elif defined GNULIB_POSIXCHECK
129  ...
130  #endif
131 
132  * For providing a replacement for a function that exists on all platforms,
133  but is broken/insufficient and needs to be replaced on some platforms:
134 
135  #if @GNULIB_FOO@
136  # if @REPLACE_FOO@
137  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
138  # undef foo
139  # define foo rpl_foo
140  # endif
141  _GL_FUNCDECL_RPL (foo, ...);
142  _GL_CXXALIAS_RPL (foo, ...);
143  # else
144  _GL_CXXALIAS_SYS (foo, ...);
145  # endif
146  _GL_CXXALIASWARN (foo);
147  #elif defined GNULIB_POSIXCHECK
148  ...
149  #endif
150 
151  * For providing a replacement for a function that exists on some platforms
152  but is broken/insufficient and needs to be replaced on some of them and
153  is additionally either missing or undeclared on some other platforms:
154 
155  #if @GNULIB_FOO@
156  # if @REPLACE_FOO@
157  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
158  # undef foo
159  # define foo rpl_foo
160  # endif
161  _GL_FUNCDECL_RPL (foo, ...);
162  _GL_CXXALIAS_RPL (foo, ...);
163  # else
164  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
165  _GL_FUNCDECL_SYS (foo, ...);
166  # endif
167  _GL_CXXALIAS_SYS (foo, ...);
168  # endif
169  _GL_CXXALIASWARN (foo);
170  #elif defined GNULIB_POSIXCHECK
171  ...
172  #endif
173 */
174 
175 /* _GL_EXTERN_C declaration;
176  performs the declaration with C linkage. */
177 #if defined __cplusplus
178 # define _GL_EXTERN_C extern "C"
179 #else
180 # define _GL_EXTERN_C extern
181 #endif
182 
183 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
184  declares a replacement function, named rpl_func, with the given prototype,
185  consisting of return type, parameters, and attributes.
186  Example:
187  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
188  _GL_ARG_NONNULL ((1)));
189  */
190 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
191  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
192 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
193  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
194 
195 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
196  declares the system function, named func, with the given prototype,
197  consisting of return type, parameters, and attributes.
198  Example:
199  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
200  _GL_ARG_NONNULL ((1)));
201  */
202 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
203  _GL_EXTERN_C rettype func parameters_and_attributes
204 
205 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
206  declares a C++ alias called GNULIB_NAMESPACE::func
207  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
208  Example:
209  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
210 
211  Wrapping rpl_func in an object with an inline conversion operator
212  avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
213  actually used in the program. */
214 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
215  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
216 #if defined __cplusplus && defined GNULIB_NAMESPACE
217 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
218  namespace GNULIB_NAMESPACE \
219  { \
220  static const struct _gl_ ## func ## _wrapper \
221  { \
222  typedef rettype (*type) parameters; \
223  \
224  inline operator type () const \
225  { \
226  return ::rpl_func; \
227  } \
228  } func = {}; \
229  } \
230  _GL_EXTERN_C int _gl_cxxalias_dummy
231 #else
232 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
233  _GL_EXTERN_C int _gl_cxxalias_dummy
234 #endif
235 
236 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
237  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
238  except that the C function rpl_func may have a slightly different
239  declaration. A cast is used to silence the "invalid conversion" error
240  that would otherwise occur. */
241 #if defined __cplusplus && defined GNULIB_NAMESPACE
242 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
243  namespace GNULIB_NAMESPACE \
244  { \
245  static const struct _gl_ ## func ## _wrapper \
246  { \
247  typedef rettype (*type) parameters; \
248  \
249  inline operator type () const \
250  { \
251  return reinterpret_cast<type>(::rpl_func); \
252  } \
253  } func = {}; \
254  } \
255  _GL_EXTERN_C int _gl_cxxalias_dummy
256 #else
257 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
258  _GL_EXTERN_C int _gl_cxxalias_dummy
259 #endif
260 
261 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
262  declares a C++ alias called GNULIB_NAMESPACE::func
263  that redirects to the system provided function func, if GNULIB_NAMESPACE
264  is defined.
265  Example:
266  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
267 
268  Wrapping func in an object with an inline conversion operator
269  avoids a reference to func unless GNULIB_NAMESPACE::func is
270  actually used in the program. */
271 #if defined __cplusplus && defined GNULIB_NAMESPACE
272 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
273  namespace GNULIB_NAMESPACE \
274  { \
275  static const struct _gl_ ## func ## _wrapper \
276  { \
277  typedef rettype (*type) parameters; \
278  \
279  inline operator type () const \
280  { \
281  return ::func; \
282  } \
283  } func = {}; \
284  } \
285  _GL_EXTERN_C int _gl_cxxalias_dummy
286 #else
287 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
288  _GL_EXTERN_C int _gl_cxxalias_dummy
289 #endif
290 
291 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
292  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
293  except that the C function func may have a slightly different declaration.
294  A cast is used to silence the "invalid conversion" error that would
295  otherwise occur. */
296 #if defined __cplusplus && defined GNULIB_NAMESPACE
297 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
298  namespace GNULIB_NAMESPACE \
299  { \
300  static const struct _gl_ ## func ## _wrapper \
301  { \
302  typedef rettype (*type) parameters; \
303  \
304  inline operator type () const \
305  { \
306  return reinterpret_cast<type>(::func); \
307  } \
308  } func = {}; \
309  } \
310  _GL_EXTERN_C int _gl_cxxalias_dummy
311 #else
312 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
313  _GL_EXTERN_C int _gl_cxxalias_dummy
314 #endif
315 
316 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
317  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
318  except that the C function is picked among a set of overloaded functions,
319  namely the one with rettype2 and parameters2. Two consecutive casts
320  are used to silence the "cannot find a match" and "invalid conversion"
321  errors that would otherwise occur. */
322 #if defined __cplusplus && defined GNULIB_NAMESPACE
323  /* The outer cast must be a reinterpret_cast.
324  The inner cast: When the function is defined as a set of overloaded
325  functions, it works as a static_cast<>, choosing the designated variant.
326  When the function is defined as a single variant, it works as a
327  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
328 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
329  namespace GNULIB_NAMESPACE \
330  { \
331  static const struct _gl_ ## func ## _wrapper \
332  { \
333  typedef rettype (*type) parameters; \
334  \
335  inline operator type () const \
336  { \
337  return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
338  } \
339  } func = {}; \
340  } \
341  _GL_EXTERN_C int _gl_cxxalias_dummy
342 #else
343 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
344  _GL_EXTERN_C int _gl_cxxalias_dummy
345 #endif
346 
347 /* _GL_CXXALIASWARN (func);
348  causes a warning to be emitted when ::func is used but not when
349  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
350  variants. */
351 #if defined __cplusplus && defined GNULIB_NAMESPACE
352 # define _GL_CXXALIASWARN(func) \
353  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
354 # define _GL_CXXALIASWARN_1(func,namespace) \
355  _GL_CXXALIASWARN_2 (func, namespace)
356 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
357  we enable the warning only when not optimizing. */
358 # if !__OPTIMIZE__
359 # define _GL_CXXALIASWARN_2(func,namespace) \
360  _GL_WARN_ON_USE (func, \
361  "The symbol ::" #func " refers to the system function. " \
362  "Use " #namespace "::" #func " instead.")
363 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
364 # define _GL_CXXALIASWARN_2(func,namespace) \
365  extern __typeof__ (func) func
366 # else
367 # define _GL_CXXALIASWARN_2(func,namespace) \
368  _GL_EXTERN_C int _gl_cxxalias_dummy
369 # endif
370 #else
371 # define _GL_CXXALIASWARN(func) \
372  _GL_EXTERN_C int _gl_cxxalias_dummy
373 #endif
374 
375 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
376  causes a warning to be emitted when the given overloaded variant of ::func
377  is used but not when GNULIB_NAMESPACE::func is used. */
378 #if defined __cplusplus && defined GNULIB_NAMESPACE
379 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
380  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
381  GNULIB_NAMESPACE)
382 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
383  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
384 /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
385  we enable the warning only when not optimizing. */
386 # if !__OPTIMIZE__
387 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
388  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
389  "The symbol ::" #func " refers to the system function. " \
390  "Use " #namespace "::" #func " instead.")
391 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
392 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
393  extern __typeof__ (func) func
394 # else
395 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
396  _GL_EXTERN_C int _gl_cxxalias_dummy
397 # endif
398 #else
399 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
400  _GL_EXTERN_C int _gl_cxxalias_dummy
401 #endif
402 
403 #endif /* _GL_CXXDEFS_H */
404 
405 /* The definition of _GL_WARN_ON_USE is copied here. */
406 /* A C macro for emitting warnings if a function is used.
407  Copyright (C) 2010-2017 Free Software Foundation, Inc.
408 
409  This program is free software: you can redistribute it and/or modify it
410  under the terms of the GNU General Public License as published
411  by the Free Software Foundation; either version 3 of the License, or
412  (at your option) any later version.
413 
414  This program is distributed in the hope that it will be useful,
415  but WITHOUT ANY WARRANTY; without even the implied warranty of
416  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
417  General Public License for more details.
418 
419  You should have received a copy of the GNU General Public License
420  along with this program. If not, see <https://www.gnu.org/licenses/>. */
421 
422 /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
423  for FUNCTION which will then trigger a compiler warning containing
424  the text of "literal string" anywhere that function is called, if
425  supported by the compiler. If the compiler does not support this
426  feature, the macro expands to an unused extern declaration.
427 
428  This macro is useful for marking a function as a potential
429  portability trap, with the intent that "literal string" include
430  instructions on the replacement function that should be used
431  instead. However, one of the reasons that a function is a
432  portability trap is if it has the wrong signature. Declaring
433  FUNCTION with a different signature in C is a compilation error, so
434  this macro must use the same type as any existing declaration so
435  that programs that avoid the problematic FUNCTION do not fail to
436  compile merely because they included a header that poisoned the
437  function. But this implies that _GL_WARN_ON_USE is only safe to
438  use if FUNCTION is known to already have a declaration. Use of
439  this macro implies that there must not be any other macro hiding
440  the declaration of FUNCTION; but undefining FUNCTION first is part
441  of the poisoning process anyway (although for symbols that are
442  provided only via a macro, the result is a compilation error rather
443  than a warning containing "literal string"). Also note that in
444  C++, it is only safe to use if FUNCTION has no overloads.
445 
446  For an example, it is possible to poison 'getline' by:
447  - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
448  [getline]) in configure.ac, which potentially defines
449  HAVE_RAW_DECL_GETLINE
450  - adding this code to a header that wraps the system <stdio.h>:
451  #undef getline
452  #if HAVE_RAW_DECL_GETLINE
453  _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
454  "not universally present; use the gnulib module getline");
455  #endif
456 
457  It is not possible to directly poison global variables. But it is
458  possible to write a wrapper accessor function, and poison that
459  (less common usage, like &environ, will cause a compilation error
460  rather than issue the nice warning, but the end result of informing
461  the developer about their portability problem is still achieved):
462  #if HAVE_RAW_DECL_ENVIRON
463  static char ***rpl_environ (void) { return &environ; }
464  _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
465  # undef environ
466  # define environ (*rpl_environ ())
467  #endif
468  */
469 #ifndef _GL_WARN_ON_USE
470 
471 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
472 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
473 # define _GL_WARN_ON_USE(function, message) \
474 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
475 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
476 /* Verify the existence of the function. */
477 # define _GL_WARN_ON_USE(function, message) \
478 extern __typeof__ (function) function
479 # else /* Unsupported. */
480 # define _GL_WARN_ON_USE(function, message) \
481 _GL_WARN_EXTERN_C int _gl_warn_on_use
482 # endif
483 #endif
484 
485 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
486  is like _GL_WARN_ON_USE (function, "string"), except that the function is
487  declared with the given prototype, consisting of return type, parameters,
488  and attributes.
489  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
490  not work in this case. */
491 #ifndef _GL_WARN_ON_USE_CXX
492 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
493 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
494 extern rettype function parameters_and_attributes \
495  __attribute__ ((__warning__ (msg)))
496 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
497 /* Verify the existence of the function. */
498 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
499 extern rettype function parameters_and_attributes
500 # else /* Unsupported. */
501 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
502 _GL_WARN_EXTERN_C int _gl_warn_on_use
503 # endif
504 #endif
505 
506 /* _GL_WARN_EXTERN_C declaration;
507  performs the declaration with C linkage. */
508 #ifndef _GL_WARN_EXTERN_C
509 # if defined __cplusplus
510 # define _GL_WARN_EXTERN_C extern "C"
511 # else
512 # define _GL_WARN_EXTERN_C extern
513 # endif
514 #endif
515 
516 /* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
517  #defines a number of identifiers in the application namespace. Revert
518  these #defines. */
519 #ifdef __sun
520 # undef multibyte
521 # undef eucw1
522 # undef eucw2
523 # undef eucw3
524 # undef scrw1
525 # undef scrw2
526 # undef scrw3
527 #endif
528 
529 /* Define wint_t and WEOF. (Also done in wchar.in.h.) */
530 #if !1 && !defined wint_t
531 # define wint_t int
532 # ifndef WEOF
533 # define WEOF -1
534 # endif
535 #else
536 /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
537  <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
538  wint_t must be "unchanged by default argument promotions". Override it. */
539 # if 0
540 # if !GNULIB_defined_wint_t
541 # if 0
542 # include <crtdefs.h>
543 # else
544 # include <stddef.h>
545 # endif
546 typedef unsigned int rpl_wint_t;
547 # undef wint_t
548 # define wint_t rpl_wint_t
549 # define GNULIB_defined_wint_t 1
550 # endif
551 # endif
552 # ifndef WEOF
553 # define WEOF ((wint_t) -1)
554 # endif
555 #endif
556 
557 
558 #if !GNULIB_defined_wctype_functions
559 
560 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
561  Linux libc5 has <wctype.h> and the functions but they are broken.
562  Assume all 11 functions (all isw* except iswblank) are implemented the
563  same way, or not at all. */
564 # if ! 1 || 0
565 
566 /* IRIX 5.3 has macros but no functions, its isw* macros refer to an
567  undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
568  refer to system functions like _iswctype that are not in the
569  standard C library. Rather than try to get ancient buggy
570  implementations like this to work, just disable them. */
571 # undef iswalnum
572 # undef iswalpha
573 # undef iswblank
574 # undef iswcntrl
575 # undef iswdigit
576 # undef iswgraph
577 # undef iswlower
578 # undef iswprint
579 # undef iswpunct
580 # undef iswspace
581 # undef iswupper
582 # undef iswxdigit
583 # undef towlower
584 # undef towupper
585 
586 /* Linux libc5 has <wctype.h> and the functions but they are broken. */
587 # if 0
588 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
589 # define iswalnum rpl_iswalnum
590 # define iswalpha rpl_iswalpha
591 # define iswblank rpl_iswblank
592 # define iswcntrl rpl_iswcntrl
593 # define iswdigit rpl_iswdigit
594 # define iswgraph rpl_iswgraph
595 # define iswlower rpl_iswlower
596 # define iswprint rpl_iswprint
597 # define iswpunct rpl_iswpunct
598 # define iswspace rpl_iswspace
599 # define iswupper rpl_iswupper
600 # define iswxdigit rpl_iswxdigit
601 # endif
602 # endif
603 # if 0
604 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
605 # define towlower rpl_towlower
606 # define towupper rpl_towupper
607 # endif
608 # endif
609 
611 # if 0
612 rpl_iswalnum
613 # else
614 iswalnum
615 # endif
616  (wint_t wc)
617 {
618  return ((wc >= '0' && wc <= '9')
619  || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
620 }
621 
623 # if 0
624 rpl_iswalpha
625 # else
626 iswalpha
627 # endif
628  (wint_t wc)
629 {
630  return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
631 }
632 
634 # if 0
635 rpl_iswblank
636 # else
637 iswblank
638 # endif
639  (wint_t wc)
640 {
641  return wc == ' ' || wc == '\t';
642 }
643 
645 # if 0
646 rpl_iswcntrl
647 # else
648 iswcntrl
649 # endif
650  (wint_t wc)
651 {
652  return (wc & ~0x1f) == 0 || wc == 0x7f;
653 }
654 
656 # if 0
657 rpl_iswdigit
658 # else
659 iswdigit
660 # endif
661  (wint_t wc)
662 {
663  return wc >= '0' && wc <= '9';
664 }
665 
667 # if 0
668 rpl_iswgraph
669 # else
670 iswgraph
671 # endif
672  (wint_t wc)
673 {
674  return wc >= '!' && wc <= '~';
675 }
676 
678 # if 0
679 rpl_iswlower
680 # else
681 iswlower
682 # endif
683  (wint_t wc)
684 {
685  return wc >= 'a' && wc <= 'z';
686 }
687 
689 # if 0
690 rpl_iswprint
691 # else
692 iswprint
693 # endif
694  (wint_t wc)
695 {
696  return wc >= ' ' && wc <= '~';
697 }
698 
700 # if 0
701 rpl_iswpunct
702 # else
703 iswpunct
704 # endif
705  (wint_t wc)
706 {
707  return (wc >= '!' && wc <= '~'
708  && !((wc >= '0' && wc <= '9')
709  || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
710 }
711 
713 # if 0
714 rpl_iswspace
715 # else
716 iswspace
717 # endif
718  (wint_t wc)
719 {
720  return (wc == ' ' || wc == '\t'
721  || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
722 }
723 
725 # if 0
726 rpl_iswupper
727 # else
728 iswupper
729 # endif
730  (wint_t wc)
731 {
732  return wc >= 'A' && wc <= 'Z';
733 }
734 
736 # if 0
737 rpl_iswxdigit
738 # else
739 iswxdigit
740 # endif
741  (wint_t wc)
742 {
743  return ((wc >= '0' && wc <= '9')
744  || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
745 }
746 
748 # if 0
749 rpl_towlower
750 # else
751 towlower
752 # endif
753  (wint_t wc)
754 {
755  return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
756 }
757 
759 # if 0
760 rpl_towupper
761 # else
762 towupper
763 # endif
764  (wint_t wc)
765 {
766  return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
767 }
768 
769 # elif 0 && (! 1 || 0)
770 /* Only the iswblank function is missing. */
771 
772 # if 0
773 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
774 # define iswblank rpl_iswblank
775 # endif
776 _GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
777 # else
778 _GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
779 # endif
780 
781 # endif
782 
783 # if defined __MINGW32__
784 
785 /* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
786  The functions towlower and towupper are implemented in the MSVCRT library
787  to take a wchar_t argument and return a wchar_t result. mingw declares
788  these functions to take a wint_t argument and return a wint_t result.
789  This means that:
790  1. When the user passes an argument outside the range 0x0000..0xFFFF, the
791  function will look only at the lower 16 bits. This is allowed according
792  to POSIX.
793  2. The return value is returned in the lower 16 bits of the result register.
794  The upper 16 bits are random: whatever happened to be in that part of the
795  result register. We need to fix this by adding a zero-extend from
796  wchar_t to wint_t after the call. */
797 
799 rpl_towlower (wint_t wc)
800 {
801  return (wint_t) (wchar_t) towlower (wc);
802 }
803 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
804 # define towlower rpl_towlower
805 # endif
806 
808 rpl_towupper (wint_t wc)
809 {
810  return (wint_t) (wchar_t) towupper (wc);
811 }
812 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
813 # define towupper rpl_towupper
814 # endif
815 
816 # endif /* __MINGW32__ */
817 
818 # define GNULIB_defined_wctype_functions 1
819 #endif
820 
821 #if 0
822 _GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
823 _GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
824 _GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
825 _GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
826 _GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
827 _GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
828 _GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
829 _GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
830 _GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
831 _GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
832 _GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
833 #else
834 _GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
835 _GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
836 _GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
837 _GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
838 _GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
839 _GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
840 _GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
841 _GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
842 _GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
843 _GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
844 _GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
845 #endif
857 
858 #if 0
859 # if 0 || 0
860 _GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
861 # else
862 _GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
863 # endif
865 #endif
866 
867 #if !1
868 # if !GNULIB_defined_wctype_t
869 typedef void * wctype_t;
870 # define GNULIB_defined_wctype_t 1
871 # endif
872 #endif
873 
874 /* Get a descriptor for a wide character property. */
875 #if 0
876 # if !1
877 _GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
878 # endif
879 _GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
880 _GL_CXXALIASWARN (wctype);
881 #elif defined GNULIB_POSIXCHECK
882 # undef wctype
883 # if HAVE_RAW_DECL_WCTYPE
884 _GL_WARN_ON_USE (wctype, "wctype is unportable - "
885  "use gnulib module wctype for portability");
886 # endif
887 #endif
888 
889 /* Test whether a wide character has a given property.
890  The argument WC must be either a wchar_t value or WEOF.
891  The argument DESC must have been returned by the wctype() function. */
892 #if 0
893 # if !1
894 _GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
895 # endif
896 _GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
897 _GL_CXXALIASWARN (iswctype);
898 #elif defined GNULIB_POSIXCHECK
899 # undef iswctype
900 # if HAVE_RAW_DECL_ISWCTYPE
901 _GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
902  "use gnulib module iswctype for portability");
903 # endif
904 #endif
905 
906 #if 0 || defined __MINGW32__
909 #else
912 #endif
915 
916 #if !1
917 # if !GNULIB_defined_wctrans_t
918 typedef void * wctrans_t;
919 # define GNULIB_defined_wctrans_t 1
920 # endif
921 #endif
922 
923 /* Get a descriptor for a wide character case conversion. */
924 #if 0
925 # if !1
926 _GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
927 # endif
928 _GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
929 _GL_CXXALIASWARN (wctrans);
930 #elif defined GNULIB_POSIXCHECK
931 # undef wctrans
932 # if HAVE_RAW_DECL_WCTRANS
933 _GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
934  "use gnulib module wctrans for portability");
935 # endif
936 #endif
937 
938 /* Perform a given case conversion on a wide character.
939  The argument WC must be either a wchar_t value or WEOF.
940  The argument DESC must have been returned by the wctrans() function. */
941 #if 0
942 # if !1
943 _GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
944 # endif
945 _GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
946 _GL_CXXALIASWARN (towctrans);
947 #elif defined GNULIB_POSIXCHECK
948 # undef towctrans
949 # if HAVE_RAW_DECL_TOWCTRANS
950 _GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
951  "use gnulib module towctrans for portability");
952 # endif
953 #endif
954 
956 
957 #endif /* _GL_WCTYPE_H */
958 #endif /* _GL_WCTYPE_H */
959 #endif
_GL_WCTYPE_INLINE int iswcntrl(wint_t wc)
Definition: wctype.in.h:224
_GL_WCTYPE_INLINE int iswblank(wint_t wc)
Definition: wctype.in.h:213
_GL_WCTYPE_INLINE int iswalnum(wint_t wc)
Definition: wctype.in.h:190
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: inet.h:168
#define _GL_WCTYPE_INLINE
Definition: wctype.h:84
_GL_WCTYPE_INLINE int iswspace(wint_t wc)
Definition: wctype.in.h:292
_GL_CXXALIAS_SYS(iswalnum, int,(wint_t wc))
#define wchar_t
Definition: stddef.in.h:81
_GL_WCTYPE_INLINE int iswgraph(wint_t wc)
Definition: wctype.in.h:246
_GL_WCTYPE_INLINE int iswupper(wint_t wc)
Definition: wctype.in.h:304
_GL_WCTYPE_INLINE int iswprint(wint_t wc)
Definition: wctype.in.h:268
_GL_WCTYPE_INLINE int iswlower(wint_t wc)
Definition: wctype.in.h:257
_GL_WCTYPE_INLINE wint_t towupper(wint_t wc)
Definition: wctype.in.h:338
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: inet.h:180
void * wctrans_t
Definition: wctype.in.h:492
#define wint_t
Definition: wchar.in.h:111
_GL_WCTYPE_INLINE int iswdigit(wint_t wc)
Definition: wctype.in.h:235
_GL_WCTYPE_INLINE wint_t towlower(wint_t wc)
Definition: wctype.in.h:327
void * wctype_t
Definition: wctype.in.h:443
_GL_CXXALIASWARN(iswalnum)
_GL_WCTYPE_INLINE int iswpunct(wint_t wc)
Definition: wctype.in.h:279
#define _GL_INLINE_HEADER_BEGIN
Definition: config.h:1817
_GL_WCTYPE_INLINE int iswalpha(wint_t wc)
Definition: wctype.in.h:202
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: inet.h:156
#define _GL_INLINE_HEADER_END
Definition: config.h:1818
#define _GL_WARN_ON_USE(function, message)
Definition: inet.h:474
_GL_WCTYPE_INLINE int iswxdigit(wint_t wc)
Definition: wctype.in.h:315