Buckets:
arudradey/fullhtml-storage / emsdk /upstream /emscripten /system /lib /llvm-libc /src /wchar /wctomb.cpp
| //===-- Implementation of wctomb ------------------------------------------===// | |
| // | |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| // See https://llvm.org/LICENSE.txt for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // | |
| //===----------------------------------------------------------------------===// | |
| namespace LIBC_NAMESPACE_DECL { | |
| LLVM_LIBC_FUNCTION(int, wctomb, (char *s, wchar_t wc)) { | |
| static internal::mbstate internal_mbstate; | |
| if (s == nullptr) | |
| return 0; | |
| auto result = internal::wcrtomb(s, wc, &internal_mbstate); | |
| if (!result.has_value()) { // invalid wide character | |
| libc_errno = EILSEQ; | |
| return -1; | |
| } | |
| return static_cast<int>(result.value()); | |
| } | |
| } // namespace LIBC_NAMESPACE_DECL | |
Xet Storage Details
- Size:
- 1.04 kB
- Xet hash:
- 99a7c56e000a8b39f3b45eec3a930f9eab9588175b06692db545314e553d8343
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.