summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/wchar.h
AgeCommit message (Collapse)Author
2022-06-30LibC: Implement `wcswidth`Tim Schumacher
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-29LibC: Make wchar size definitions available from stdint.hTim Schumacher
POSIX describes WCHAR_MIN and WCHAR_MAX in stdint.h(0P), while wchar.h(0P) only says "as described in stdint.h". As there isn't a trivial path of "may make visible", just move it to a shared header and include it from both files.
2022-03-19Revert "LibC: Make WEOF a signed value on clang"Tim Schumacher
We have fixed Clang to define `wint_t` as an unsigned value. This reverts commit ccb9cae8e903a8043f813675639831e1890190c7.
2021-12-21LibC: Make WEOF a signed value on clangAli Mohammad Pur
The actual value is unchanged, but the previous `0xffffffff` was an unsigned value, which lead to clang getting mad at `foowc() == WEOF`. This commit makes it a signed int on clang, which *should* serve the same purpose and not lead to clang getting mad at us.
2021-12-21LibC: Define WCHAR_{MIN,MAX}Ali Mohammad Pur
2021-12-21LibC: Stub out wcsftime()Ali Mohammad Pur
2021-12-21LibC: Implement ungetwc()Ali Mohammad Pur
2021-12-21LibC: Stub out some wscanf variantsAli Mohammad Pur
2021-12-21LibC+AK: Implement all sorts of wprintf variantsAli Mohammad Pur
2021-12-21LibC: Implement f{get,put}ws()Ali Mohammad Pur
2021-12-21LibC: Stub out fwide()Ali Mohammad Pur
This is a mess, and I'd rather not perform checks on every single stdio operation, so just make it a noop.
2021-12-21LibC: Implement {f,}putwc()Ali Mohammad Pur
2021-12-21LibC: Implement getwchar()Ali Mohammad Pur
2021-12-21LibC: Implement {f,}getwc()Ali Mohammad Pur
2021-12-21LibC: Implement wcs{,c}spn()Ali Mohammad Pur
2021-12-19LibC: Implement wcsdupTim Schumacher
2021-10-17LibC: Primitively implement wcsxfrmDaniel Bertalan
The `wcsxfrm` function copies a wide character string into a buffer, such that comparing the new string against any similarly pre-processed string with `wcscmp` produces the same result as if the original strings were compared with `wcscoll`. Our current `wcscoll` implementation is simply an alias for `wcscmp`, so `wcsxfrm` needs to perform no actions other than copying the string.
2021-10-17LibC: Implement wcslcpyDaniel Bertalan
2021-10-17LibC: Fix wcsrchr declaration to return a non-const wchar*Daniel Bertalan
This is how the standard specifies it; similarly to the already correctly declared wcschr function.
2021-10-17LibC: Stub out mbsnrtowcsDaniel Bertalan
2021-10-17LibC: Stub out wcsnrtombsDaniel Bertalan
2021-10-17LibC: Implement wmemcmpDaniel Bertalan
2021-10-17LibC: Forward-declare `struct tm` in wchar.hDaniel Bertalan
The C standard specifies that this forward-declaration be present in wchar.h, and is needed in order to build libstdc++.
2021-10-15LibC: Implement mbsrtowcsTim Schumacher
2021-10-15LibC: Implement wcsrtombsTim Schumacher
2021-10-15LibC: Partially implement wcwidthTim Schumacher
2021-10-03LibC: Manually count stored bytes in mbstate_tTim Schumacher
This is probably a bit faster than constantly having to look through all stored bytes. It also helps when we are trying to store actual null bytes.
2021-10-03LibC: Remove the mbstate_reset helperTim Schumacher
A zero-initialized mbstate_t struct has to be a valid initial state, so we can just zero-initialize it whenever we need to reset. Having a helper function for resetting the struct might imply that you can add additional setup operations afterwards, which is not the case.
2021-10-03LibC: Stub out swprintfTim Schumacher
2021-10-03LibC: Stub out wcstoldTim Schumacher
2021-10-03LibC: Stub out wcstodTim Schumacher
2021-10-03LibC: Stub out wcstofTim Schumacher
2021-10-03LibC: Stub out wcstoullTim Schumacher
2021-10-03LibC: Stub out wcstoulTim Schumacher
2021-10-03LibC: Implement wmemmoveTim Schumacher
2021-10-03LibC: Implement wmemsetTim Schumacher
2021-10-03LibC: Implement wmemcpyTim Schumacher
2021-10-03LibC: Implement wmemchrTim Schumacher
2021-10-03LibC: Implement wcsstrTim Schumacher
2021-10-03LibC: Implement wcspbrkTim Schumacher
2021-09-16LibC: Implement mbsinit and mbrtowcTim Schumacher
2021-09-16LibC: Stub out a bunch of wchar functionsTim Schumacher
2021-09-16LibC: Provide a dummy mbstate_t in wchar.hTim Schumacher
POSIX just says that mbstate_t should be an "object type other than an array type" that can hold the conversion state for converting between (multi-byte) characters and wide characters. Since no other information regarding the contents is given, this apparently means that we should add whatever we need once we start implementing that conversion.
2021-05-30LibC: Add stubs for wctype and iswctypeTim Schumacher
2021-05-30LibC: Stub out btowcTim Schumacher
wint_t is also not supposed to be defined by sys/types.h, but should be defined in wchar.h instead. Since we require it for our definition of btowc, let's move it to the correct place.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-01-18LibC: Add wcstol() and wcstoll() stubsLinus Groh
2021-01-18LibC: Add wcsncmp()Linus Groh
Taken from strncmp(), like wcscmp() in ef40ebb. :^)
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling