Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Louis Dionne | eb8650a | 2021-11-17 16:25:01 -0500 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 3 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_WCTYPE_H |
| 11 | #define _LIBCPP_WCTYPE_H |
| 12 | |
| 13 | /* |
| 14 | wctype.h synopsis |
| 15 | |
| 16 | Macros: |
| 17 | |
| 18 | WEOF |
| 19 | |
| 20 | Types: |
| 21 | |
| 22 | wint_t |
| 23 | wctrans_t |
| 24 | wctype_t |
| 25 | |
| 26 | int iswalnum(wint_t wc); |
| 27 | int iswalpha(wint_t wc); |
| 28 | int iswblank(wint_t wc); // C99 |
| 29 | int iswcntrl(wint_t wc); |
| 30 | int iswdigit(wint_t wc); |
| 31 | int iswgraph(wint_t wc); |
| 32 | int iswlower(wint_t wc); |
| 33 | int iswprint(wint_t wc); |
| 34 | int iswpunct(wint_t wc); |
| 35 | int iswspace(wint_t wc); |
| 36 | int iswupper(wint_t wc); |
| 37 | int iswxdigit(wint_t wc); |
| 38 | int iswctype(wint_t wc, wctype_t desc); |
| 39 | wctype_t wctype(const char* property); |
| 40 | wint_t towlower(wint_t wc); |
| 41 | wint_t towupper(wint_t wc); |
| 42 | wint_t towctrans(wint_t wc, wctrans_t desc); |
| 43 | wctrans_t wctrans(const char* property); |
| 44 | |
| 45 | */ |
| 46 | |
Nikolas Klauser | b9a2658 | 2024-12-21 13:01:48 +0100 | [diff] [blame] | 47 | #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
| 48 | # include <__cxx03/wctype.h> |
| 49 | #else |
Nikolas Klauser | c166a9c | 2024-12-10 16:02:12 +0100 | [diff] [blame] | 50 | # include <__config> |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 51 | |
Nikolas Klauser | c166a9c | 2024-12-10 16:02:12 +0100 | [diff] [blame] | 52 | # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 53 | # pragma GCC system_header |
| 54 | # endif |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 55 | |
Louis Dionne | a4357bc | 2021-08-25 12:27:20 -0400 | [diff] [blame] | 56 | // TODO: |
| 57 | // In the future, we should unconditionally include_next <wctype.h> here and instead |
| 58 | // have a mode under which the library does not need libc++'s <wctype.h> or <cwctype> |
| 59 | // at all (i.e. a mode without wchar_t). As it stands, we need to do that to completely |
| 60 | // bypass the using declarations in <cwctype> when we did not include <wctype.h>. |
| 61 | // Otherwise, a using declaration like `using ::wint_t` in <cwctype> will refer to |
| 62 | // nothing (with using_if_exists), and if we include another header that defines one |
| 63 | // of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists |
| 64 | // will fail because it does not refer to the same declaration. |
Nikolas Klauser | c166a9c | 2024-12-10 16:02:12 +0100 | [diff] [blame] | 65 | # if __has_include_next(<wctype.h>) |
| 66 | # include_next <wctype.h> |
| 67 | # define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H |
| 68 | # endif |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 69 | |
Nikolas Klauser | c166a9c | 2024-12-10 16:02:12 +0100 | [diff] [blame] | 70 | # ifdef __cplusplus |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 71 | |
Nikolas Klauser | c166a9c | 2024-12-10 16:02:12 +0100 | [diff] [blame] | 72 | # undef iswalnum |
| 73 | # undef iswalpha |
| 74 | # undef iswblank |
| 75 | # undef iswcntrl |
| 76 | # undef iswdigit |
| 77 | # undef iswgraph |
| 78 | # undef iswlower |
| 79 | # undef iswprint |
| 80 | # undef iswpunct |
| 81 | # undef iswspace |
| 82 | # undef iswupper |
| 83 | # undef iswxdigit |
| 84 | # undef iswctype |
| 85 | # undef wctype |
| 86 | # undef towlower |
| 87 | # undef towupper |
| 88 | # undef towctrans |
| 89 | # undef wctrans |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 90 | |
Nikolas Klauser | c166a9c | 2024-12-10 16:02:12 +0100 | [diff] [blame] | 91 | # endif // __cplusplus |
Nikolas Klauser | b9a2658 | 2024-12-21 13:01:48 +0100 | [diff] [blame] | 92 | #endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) |
Richard Smith | a6e8ebb | 2015-10-09 19:57:37 +0000 | [diff] [blame] | 93 | |
Louis Dionne | 4cd6ca1 | 2021-04-20 12:03:32 -0400 | [diff] [blame] | 94 | #endif // _LIBCPP_WCTYPE_H |