Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:33

0001 //===-----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___CXX03___LOCALE_DIR_LOCALE_BASE_API_H
0010 #define _LIBCPP___CXX03___LOCALE_DIR_LOCALE_BASE_API_H
0011 
0012 #if defined(_LIBCPP_MSVCRT_LIKE)
0013 #  include <__cxx03/__locale_dir/locale_base_api/win32.h>
0014 #elif defined(_AIX) || defined(__MVS__)
0015 #  include <__cxx03/__locale_dir/locale_base_api/ibm.h>
0016 #elif defined(__ANDROID__)
0017 #  include <__cxx03/__locale_dir/locale_base_api/android.h>
0018 #elif defined(__sun__)
0019 #  include <__cxx03/__locale_dir/locale_base_api/solaris.h>
0020 #elif defined(_NEWLIB_VERSION)
0021 #  include <__cxx03/__locale_dir/locale_base_api/newlib.h>
0022 #elif defined(__OpenBSD__)
0023 #  include <__cxx03/__locale_dir/locale_base_api/openbsd.h>
0024 #elif defined(__Fuchsia__)
0025 #  include <__cxx03/__locale_dir/locale_base_api/fuchsia.h>
0026 #elif defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
0027 #  include <__cxx03/__locale_dir/locale_base_api/musl.h>
0028 #elif defined(__APPLE__) || defined(__FreeBSD__)
0029 #  include <__cxx03/xlocale.h>
0030 #endif
0031 
0032 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0033 #  pragma GCC system_header
0034 #endif
0035 
0036 /*
0037 The platform-specific headers have to provide the following interface:
0038 
0039 // TODO: rename this to __libcpp_locale_t
0040 using locale_t = implementation-defined;
0041 
0042 implementation-defined __libcpp_mb_cur_max_l(locale_t);
0043 wint_t __libcpp_btowc_l(int, locale_t);
0044 int __libcpp_wctob_l(wint_t, locale_t);
0045 size_t __libcpp_wcsnrtombs_l(char* dest, const wchar_t** src, size_t wide_char_count, size_t len, mbstate_t, locale_t);
0046 size_t __libcpp_wcrtomb_l(char* str, wchar_t wide_char, mbstate_t*, locale_t);
0047 size_t __libcpp_mbsnrtowcs_l(wchar_t* dest, const char** src, size_t max_out, size_t len, mbstate_t*, locale_t);
0048 size_t __libcpp_mbrtowc_l(wchar_t* dest, cosnt char* src, size_t count, mbstate_t*, locale_t);
0049 int __libcpp_mbtowc_l(wchar_t* dest, const char* src, size_t count, locale_t);
0050 size_t __libcpp_mbrlen_l(const char* str, size_t count, mbstate_t*, locale_t);
0051 lconv* __libcpp_localeconv_l(locale_t);
0052 size_t __libcpp_mbsrtowcs_l(wchar_t* dest, const char** src, size_t len, mbstate_t*, locale_t);
0053 int __libcpp_snprintf_l(char* dest, size_t buff_size, locale_t, const char* format, ...);
0054 int __libcpp_asprintf_l(char** dest, locale_t, const char* format, ...);
0055 int __libcpp_sscanf_l(const char* dest, locale_t, const char* format, ...);
0056 
0057 // TODO: change these to reserved names
0058 float strtof_l(const char* str, char** str_end, locale_t);
0059 double strtod_l(const char* str, char** str_end, locale_t);
0060 long double strtold_l(const char* str, char** str_end, locale_t);
0061 long long strtoll_l(const char* str, char** str_end, locale_t);
0062 unsigned long long strtoull_l(const char* str, char** str_end, locale_t);
0063 
0064 locale_t newlocale(int category_mask, const char* locale, locale_t base);
0065 void freelocale(locale_t);
0066 
0067 int islower_l(int ch, locale_t);
0068 int isupper_l(int ch, locale_t);
0069 int isdigit_l(int ch, locale_t);
0070 int isxdigit_l(int ch, locale_t);
0071 int strcoll_l(const char* lhs, const char* rhs, locale_t);
0072 size_t strxfrm_l(char* dst, const char* src, size_t n, locale_t);
0073 int wcscoll_l(const char* lhs, const char* rhs, locale_t);
0074 size_t wcsxfrm_l(wchar_t* dst, const wchar_t* src, size_t n, locale_t);
0075 int toupper_l(int ch, locale_t);
0076 int tolower_l(int ch, locale_t);
0077 int iswspace_l(wint_t ch, locale_t);
0078 int iswprint_l(wint_t ch, locale_t);
0079 int iswcntrl_l(wint_t ch, locale_t);
0080 int iswupper_l(wint_t ch, locale_t);
0081 int iswlower_l(wint_t ch, locale_t);
0082 int iswalpha_l(wint_t ch, locale_t);
0083 int iswblank_l(wint_t ch, locale_t);
0084 int iswdigit_l(wint_t ch, locale_t);
0085 int iswpunct_l(wint_t ch, locale_t);
0086 int iswxdigit_l(wint_t ch, locale_t);
0087 wint_t towupper_l(wint_t ch, locale_t);
0088 wint_t towlower_l(wint_t ch, locale_t);
0089 size_t strftime_l(char* str, size_t len, const char* format, const tm*, locale_t);
0090 
0091 
0092 These functions are equivalent to their C counterparts,
0093 except that locale_t is used instead of the current global locale.
0094 
0095 The variadic functions may be implemented as templates with a parameter pack instead of variadic functions.
0096 */
0097 
0098 #endif // _LIBCPP___CXX03___LOCALE_DIR_LOCALE_BASE_API_H