Commit Graph

64 Commits

Author SHA1 Message Date
4lDO2 1c5732ba36 Share almost all code between printf and wprintf. 2025-10-07 15:58:34 +02:00
4lDO2 96917f519e Reuse PrintfIter for both printf and wprintf. 2025-10-06 16:16:48 +02:00
4lDO2 62cc63c351 WIP: Reimpl WPrintfIter also in safe code. 2025-10-06 16:16:48 +02:00
4lDO2 6dc2606886 Expand CStr to make PrintfIter fully safe. 2025-10-06 16:16:48 +02:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Nicolás Antinori 28b471300b added vwscanf 2025-02-09 02:29:20 -03:00
Nicolás Antinori 230a15046d cleanup 2025-02-08 14:24:44 -03:00
Nicolás Antinori 47ed7a5907 fixed return value 2025-02-08 14:11:25 -03:00
Nicolás Antinori da3e1e94fa added get_char_encoded_length function 2025-02-08 14:05:37 -03:00
Nicolás Antinori ca9cfde3d6 clean up code 2025-02-07 16:04:25 -03:00
Nicolás Antinori 9d49a2745f it is working, but with an unsafe 2025-02-07 15:56:21 -03:00
Nicolás Antinori 61c31f348c changed wscanf parameters 2025-02-06 19:58:54 -03:00
Nicolás Antinori 18659e821f compiling but not working :) 2025-02-06 19:45:54 -03:00
Jeremy Soller 90f30c5f51 Make NulTerminated::new return option 2025-01-09 13:33:56 -07:00
Josh Megnauth 5348273ccc Emit C attributes via cbindgen 2024-11-17 16:15:07 +00:00
Peter Limkilde Svendsen 41264dc8b1 Add NulTerminatedInclusive iterator, rewrite/fix strchr/wcschr 2024-10-22 22:12:24 +00:00
Peter Limkilde Svendsen 0a23acd401 Implement iterators on pointers 2024-09-22 23:42:28 +00:00
Nicolás Antinori 198c5502b7 swscanf and vswscanf implementation proposal 2024-08-01 18:41:14 +00:00
Peter Limkilde Svendsen a7137512fa Use standard casing and mangling for internal errno 2024-03-01 00:25:42 +00:00
Peter Limkilde Svendsen 9093f6bc47 Use Cell representation for errno 2024-02-29 14:07:40 +00:00
4lDO2 5630b6e0df Make relibc (except libm) pure Rust 2024-01-11 13:08:06 +00:00
4lDO2 ae46e37ca7 Run rustfmt 2023-10-26 15:51:04 +02:00
Darley Barreto f7d151e287 Simplify wcsrtombs and make test follow standard 2023-10-25 09:13:41 -03:00
Jeremy Soller 76242fc7bc Merge branch 'fix/ungetwc' into 'master'
Fix ungetwc for multi byte chars

See merge request redox-os/relibc!425
2023-10-19 14:58:57 +00:00
Darley Barreto 3d2dd71b8b Fix ungetwc for multi byte chars 2023-10-19 14:58:57 +00:00
Darley Barreto 05992b8451 Add wcpcpy, wcpncpy, wcsdup, wcsnlen, wcsnrtombs 2023-10-19 14:58:37 +00:00
Darley Barreto db9bbaeb48 Make fgetwc real multibyte 2023-10-14 00:29:42 +00:00
Jeremy Soller 63b7b76ab3 Format 2023-05-22 10:01:18 -06:00
Darley Barreto 9642d2ab02 Adding some wcst* functions 2023-05-22 16:01:04 +00:00
4lDO2 cdd0f67b23 Rustfmt. 2023-05-17 15:28:10 +02:00
Jeremy Soller 51c93c4b39 Cleanup of wchar_t and wint_t definitions 2023-05-11 10:41:49 -06:00
Jeremy Soller 29c898dff0 Cargo format 2023-05-11 07:48:51 -06:00
Jeremy Soller e1ecdbd8a5 Implement vfwprintf 2023-05-11 07:48:49 -06:00
Jeremy Soller 5a5bd0c983 Add stubs for wprintf functions 2023-05-11 07:48:21 -06:00
Darley Barreto 82eb083091 Fixing wcsrtombs 2023-05-10 12:48:33 +00:00
Darley Barreto c659bf11f9 Implementing ungetwc 2023-05-09 14:23:25 +00:00
Darley Barreto 7155005be2 Adding wcsrtombs. 2023-05-08 12:39:53 +00:00
Jeremy Soller 393489b38b Add wcswidth and test 2022-12-16 17:39:06 -07:00
Jeremy Soller f65c1c27c7 Implement wcwidth 2022-11-10 10:12:41 -07:00
4lDO2 700c53cf17 Update toolchain to 2021-06-15 2021-06-17 22:31:30 +02:00
Wren Turkal 865b7962a1 Add implmentation for fwide posix function.
This function is used to set the orientation of a stream to either
byte-oriented or wchar-oriented.

More info on this function is here:
https://man7.org/linux/man-pages/man3/fwide.3p.html

This implementation only impmlemnts the manual switching and does
not yet guard against using a byte-oriented stream with wchar
functions and vice versa. Those step will come in additional
commits.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
2020-07-08 14:33:06 -07:00
jD91mZM2 593925ceb4 Unambiguate all include guards
GNU binutils also uses _FNMATCH_H for a guard, maybe along others!
2020-06-29 11:34:51 +02:00
oddcoder eac69c920d Implement wcscasecmp and wcsncasecmp
This patch implements wcscasecmp and wcsncasecmp. These two
function are required for binutils to link against relibc.
2020-04-26 19:13:03 +02:00
oddcoder 162999ac0b Move towlower and towupper to wctype.h and Implement it
This patch creates wctype.h and impelementat two functions
that belong to that header file towupper and towlower. These
functions are building blocks for wcscasecmp and wcsncasecmp
which are utilized by binutils.

The implementation for towlower and towupper seams to be complex
so this implementation is mimicking that of musl libc
2020-04-26 19:13:03 +02:00
Peter Limkilde Svendsen 0b2c3fe5ea Implement wcsstr(), fix return type of wcslen() 2019-11-14 02:46:53 +00:00
jD91mZM2 b8c50c7c64 Format 2019-08-04 19:05:45 +02:00
jD91mZM2 c7d499d4f2 Upgrade to the 2018 edition
I didn't think it'd be this useful first, but thank god for `cargo fix --edition`!
2019-08-04 19:05:45 +02:00
jD91mZM2 a8280e8991 Implement wcstol, wcstod, and printf:ing wchars 2019-07-18 12:29:22 +02:00
jD91mZM2 7c99077248 Implement wcstok 2019-07-18 08:15:40 +02:00
Mateusz Mikuła 63a1319e50 Cbindgen update 2019-07-10 10:08:39 +00:00