|
|
|||
File indexing completed on 2026-05-03 08:14:08
0001 // -*- C++ -*- 0002 //===----------------------------------------------------------------------===// 0003 // 0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 0005 // See https://llvm.org/LICENSE.txt for license information. 0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 0007 // 0008 //===----------------------------------------------------------------------===// 0009 0010 /* 0011 wchar.h synopsis 0012 0013 Macros: 0014 0015 NULL 0016 WCHAR_MAX 0017 WCHAR_MIN 0018 WEOF 0019 0020 Types: 0021 0022 mbstate_t 0023 size_t 0024 tm 0025 wint_t 0026 0027 int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); 0028 int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); 0029 int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); 0030 int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); 0031 int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); 0032 int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99 0033 int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); 0034 int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99 0035 int vwprintf(const wchar_t* restrict format, va_list arg); 0036 int vwscanf(const wchar_t* restrict format, va_list arg); // C99 0037 int wprintf(const wchar_t* restrict format, ...); 0038 int wscanf(const wchar_t* restrict format, ...); 0039 wint_t fgetwc(FILE* stream); 0040 wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); 0041 wint_t fputwc(wchar_t c, FILE* stream); 0042 int fputws(const wchar_t* restrict s, FILE* restrict stream); 0043 int fwide(FILE* stream, int mode); 0044 wint_t getwc(FILE* stream); 0045 wint_t getwchar(); 0046 wint_t putwc(wchar_t c, FILE* stream); 0047 wint_t putwchar(wchar_t c); 0048 wint_t ungetwc(wint_t c, FILE* stream); 0049 double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); 0050 float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 0051 long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 0052 long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 0053 long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 0054 unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); 0055 unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 0056 wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); 0057 wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 0058 wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); 0059 wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 0060 int wcscmp(const wchar_t* s1, const wchar_t* s2); 0061 int wcscoll(const wchar_t* s1, const wchar_t* s2); 0062 int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); 0063 size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 0064 const wchar_t* wcschr(const wchar_t* s, wchar_t c); 0065 wchar_t* wcschr( wchar_t* s, wchar_t c); 0066 size_t wcscspn(const wchar_t* s1, const wchar_t* s2); 0067 size_t wcslen(const wchar_t* s); 0068 const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); 0069 wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); 0070 const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); 0071 wchar_t* wcsrchr( wchar_t* s, wchar_t c); 0072 size_t wcsspn(const wchar_t* s1, const wchar_t* s2); 0073 const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); 0074 wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); 0075 wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); 0076 const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); 0077 wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n); 0078 int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 0079 wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); 0080 wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); 0081 wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); 0082 size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, 0083 const tm* restrict timeptr); 0084 wint_t btowc(int c); 0085 int wctob(wint_t c); 0086 int mbsinit(const mbstate_t* ps); 0087 size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); 0088 size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); 0089 size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); 0090 size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, 0091 mbstate_t* restrict ps); 0092 size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, 0093 mbstate_t* restrict ps); 0094 0095 */ 0096 0097 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) 0098 # include <__cxx03/wchar.h> 0099 #else 0100 # include <__config> 0101 0102 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 0103 # pragma GCC system_header 0104 # endif 0105 0106 // We define this here to support older versions of glibc <wchar.h> that do 0107 // not define this for clang. 0108 # if defined(__cplusplus) && !defined(__CORRECT_ISO_CPP_WCHAR_H_PROTO) 0109 # define __CORRECT_ISO_CPP_WCHAR_H_PROTO 0110 # endif 0111 0112 // The inclusion of the system's <wchar.h> is intentionally done once outside of any include 0113 // guards because some code expects to be able to include the underlying system header multiple 0114 // times to get different definitions based on the macros that are set before inclusion. 0115 # if __has_include_next(<wchar.h>) 0116 # include_next <wchar.h> 0117 # endif 0118 0119 # ifndef _LIBCPP_WCHAR_H 0120 # define _LIBCPP_WCHAR_H 0121 0122 # include <__mbstate_t.h> // provide mbstate_t 0123 # include <stddef.h> // provide size_t 0124 0125 // Determine whether we have const-correct overloads for wcschr and friends. 0126 # if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_) 0127 # define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1 0128 # elif defined(__GLIBC_PREREQ) 0129 # if __GLIBC_PREREQ(2, 10) 0130 # define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1 0131 # endif 0132 # elif defined(_LIBCPP_MSVCRT) 0133 # if defined(_CRT_CONST_CORRECT_OVERLOADS) 0134 # define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1 0135 # endif 0136 # endif 0137 0138 # if _LIBCPP_HAS_WIDE_CHARACTERS 0139 # if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD) 0140 extern "C++" { 0141 inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) { 0142 return (wchar_t*)wcschr(__s, __c); 0143 } 0144 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) { 0145 return __libcpp_wcschr(__s, __c); 0146 } 0147 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcschr(wchar_t* __s, wchar_t __c) { 0148 return __libcpp_wcschr(__s, __c); 0149 } 0150 0151 inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) { 0152 return (wchar_t*)wcspbrk(__s1, __s2); 0153 } 0154 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t* 0155 wcspbrk(const wchar_t* __s1, const wchar_t* __s2) { 0156 return __libcpp_wcspbrk(__s1, __s2); 0157 } 0158 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcspbrk(wchar_t* __s1, const wchar_t* __s2) { 0159 return __libcpp_wcspbrk(__s1, __s2); 0160 } 0161 0162 inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) { 0163 return (wchar_t*)wcsrchr(__s, __c); 0164 } 0165 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) { 0166 return __libcpp_wcsrchr(__s, __c); 0167 } 0168 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcsrchr(wchar_t* __s, wchar_t __c) { 0169 return __libcpp_wcsrchr(__s, __c); 0170 } 0171 0172 inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) { 0173 return (wchar_t*)wcsstr(__s1, __s2); 0174 } 0175 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t* 0176 wcsstr(const wchar_t* __s1, const wchar_t* __s2) { 0177 return __libcpp_wcsstr(__s1, __s2); 0178 } 0179 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wcsstr(wchar_t* __s1, const wchar_t* __s2) { 0180 return __libcpp_wcsstr(__s1, __s2); 0181 } 0182 0183 inline _LIBCPP_HIDE_FROM_ABI wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) { 0184 return (wchar_t*)wmemchr(__s, __c, __n); 0185 } 0186 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD const wchar_t* 0187 wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) { 0188 return __libcpp_wmemchr(__s, __c, __n); 0189 } 0190 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wmemchr(wchar_t* __s, wchar_t __c, size_t __n) { 0191 return __libcpp_wmemchr(__s, __c, __n); 0192 } 0193 } 0194 # endif 0195 0196 # if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__)) 0197 extern "C" { 0198 size_t mbsnrtowcs( 0199 wchar_t* __restrict __dst, const char** __restrict __src, size_t __nmc, size_t __len, mbstate_t* __restrict __ps); 0200 size_t wcsnrtombs( 0201 char* __restrict __dst, const wchar_t** __restrict __src, size_t __nwc, size_t __len, mbstate_t* __restrict __ps); 0202 } // extern "C" 0203 # endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__) 0204 # endif // _LIBCPP_HAS_WIDE_CHARACTERS 0205 # endif // _LIBCPP_WCHAR_H 0206 0207 #endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|