Warning: This file is not a C or C++ file. It does not have highlighting.

1//===-----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef _LIBCPP___CXX03___LOCALE_DIR_LOCALE_BASE_API_H
10#define _LIBCPP___CXX03___LOCALE_DIR_LOCALE_BASE_API_H
11
12#if defined(_LIBCPP_MSVCRT_LIKE)
13# include <__cxx03/__locale_dir/locale_base_api/win32.h>
14#elif defined(_AIX) || defined(__MVS__)
15# include <__cxx03/__locale_dir/locale_base_api/ibm.h>
16#elif defined(__ANDROID__)
17# include <__cxx03/__locale_dir/locale_base_api/android.h>
18#elif defined(__sun__)
19# include <__cxx03/__locale_dir/locale_base_api/solaris.h>
20#elif defined(_NEWLIB_VERSION)
21# include <__cxx03/__locale_dir/locale_base_api/newlib.h>
22#elif defined(__OpenBSD__)
23# include <__cxx03/__locale_dir/locale_base_api/openbsd.h>
24#elif defined(__Fuchsia__)
25# include <__cxx03/__locale_dir/locale_base_api/fuchsia.h>
26#elif defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
27# include <__cxx03/__locale_dir/locale_base_api/musl.h>
28#elif defined(__APPLE__) || defined(__FreeBSD__)
29# include <__cxx03/xlocale.h>
30#endif
31
32#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
33# pragma GCC system_header
34#endif
35
36/*
37The platform-specific headers have to provide the following interface:
38
39// TODO: rename this to __libcpp_locale_t
40using locale_t = implementation-defined;
41
42implementation-defined __libcpp_mb_cur_max_l(locale_t);
43wint_t __libcpp_btowc_l(int, locale_t);
44int __libcpp_wctob_l(wint_t, locale_t);
45size_t __libcpp_wcsnrtombs_l(char* dest, const wchar_t** src, size_t wide_char_count, size_t len, mbstate_t, locale_t);
46size_t __libcpp_wcrtomb_l(char* str, wchar_t wide_char, mbstate_t*, locale_t);
47size_t __libcpp_mbsnrtowcs_l(wchar_t* dest, const char** src, size_t max_out, size_t len, mbstate_t*, locale_t);
48size_t __libcpp_mbrtowc_l(wchar_t* dest, cosnt char* src, size_t count, mbstate_t*, locale_t);
49int __libcpp_mbtowc_l(wchar_t* dest, const char* src, size_t count, locale_t);
50size_t __libcpp_mbrlen_l(const char* str, size_t count, mbstate_t*, locale_t);
51lconv* __libcpp_localeconv_l(locale_t);
52size_t __libcpp_mbsrtowcs_l(wchar_t* dest, const char** src, size_t len, mbstate_t*, locale_t);
53int __libcpp_snprintf_l(char* dest, size_t buff_size, locale_t, const char* format, ...);
54int __libcpp_asprintf_l(char** dest, locale_t, const char* format, ...);
55int __libcpp_sscanf_l(const char* dest, locale_t, const char* format, ...);
56
57// TODO: change these to reserved names
58float strtof_l(const char* str, char** str_end, locale_t);
59double strtod_l(const char* str, char** str_end, locale_t);
60long double strtold_l(const char* str, char** str_end, locale_t);
61long long strtoll_l(const char* str, char** str_end, locale_t);
62unsigned long long strtoull_l(const char* str, char** str_end, locale_t);
63
64locale_t newlocale(int category_mask, const char* locale, locale_t base);
65void freelocale(locale_t);
66
67int islower_l(int ch, locale_t);
68int isupper_l(int ch, locale_t);
69int isdigit_l(int ch, locale_t);
70int isxdigit_l(int ch, locale_t);
71int strcoll_l(const char* lhs, const char* rhs, locale_t);
72size_t strxfrm_l(char* dst, const char* src, size_t n, locale_t);
73int wcscoll_l(const char* lhs, const char* rhs, locale_t);
74size_t wcsxfrm_l(wchar_t* dst, const wchar_t* src, size_t n, locale_t);
75int toupper_l(int ch, locale_t);
76int tolower_l(int ch, locale_t);
77int iswspace_l(wint_t ch, locale_t);
78int iswprint_l(wint_t ch, locale_t);
79int iswcntrl_l(wint_t ch, locale_t);
80int iswupper_l(wint_t ch, locale_t);
81int iswlower_l(wint_t ch, locale_t);
82int iswalpha_l(wint_t ch, locale_t);
83int iswblank_l(wint_t ch, locale_t);
84int iswdigit_l(wint_t ch, locale_t);
85int iswpunct_l(wint_t ch, locale_t);
86int iswxdigit_l(wint_t ch, locale_t);
87wint_t towupper_l(wint_t ch, locale_t);
88wint_t towlower_l(wint_t ch, locale_t);
89size_t strftime_l(char* str, size_t len, const char* format, const tm*, locale_t);
90
91
92These functions are equivalent to their C counterparts,
93except that locale_t is used instead of the current global locale.
94
95The variadic functions may be implemented as templates with a parameter pack instead of variadic functions.
96*/
97
98#endif // _LIBCPP___CXX03___LOCALE_DIR_LOCALE_BASE_API_H
99

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of libcxx/include/__cxx03/__locale_dir/locale_base_api.h