Repository navigation
feat(libc): implement the C locale wide character class functions - #1783
Merged
Merged
Conversation
babyhuey
force-pushed
the
feat/libc-wide-ctype
branch
from
October 8, 2026 21:36
e943258 to
18cc1d6
Compare
9 tasks done
babyhuey
force-pushed
the
feat/libc-wide-ctype
branch
from
October 9, 2026 08:32
18cc1d6 to
10ff0ce
Compare
Contributor
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
babyhuey
force-pushed
the
feat/libc-wide-ctype
branch
2 times, most recently
from
October 9, 2026 21:31
bf45df7 to
6341ce6
Compare
Progress report (2f250f8 → 1bfb3cb)📈 System libraries: 85.77% (+0.08%, +18 implemented functions) ✅ 18 implemented
|
babyhuey
force-pushed
the
feat/libc-wide-ctype
branch
6 times, most recently
from
October 10, 2026 06:18
38f15a2 to
0e6d328
Compare
babyhuey
force-pushed
the
feat/libc-wide-ctype
branch
from
October 10, 2026 07:19
0e6d328 to
1bfb3cb
Compare
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the C locale wide character class functions in libc on top of the rune locale from #1781:
iswalnum,iswalpha,iswblank,iswcntrl,iswdigit,iswgraph,iswlower,iswprint,iswpunct,iswspace,iswupper,iswxdigit,iswctype,wctype,towlower,towupper,btowcandwctob.Following FreeBSD 11
_ctype.h,wctype.c,btowc.c,wctob.candnone.cfor the C locale, the only onesetlocaleaccepts:isw*andiswctypetest_CurrentRuneLocale->__runetype[c]for 0..255 and are false above 0xFF and forWEOF(the_extranges are empty).iswalnumis_CTYPE_A|_CTYPE_N.wctypereturns FreeBSD's_CTYPE_*masks for the twelve standard names and the BSDideogram,special,phonogram,numberandrune, and 0 for any other name.towlower/towuppermap 0..255 through__maplower/__mapupperand return anything else unchanged.btowc(EOF)isWEOF; any other value is(unsigned char)c.wctobreturns the value for 0..255 andEOFotherwise, includingWEOF.Found with
tools/import_audit.pyon the catalog homebrew titles: each of these is absent in 9 or 10 of 36 audited titles.Builds on #1781, which has merged; this branch is now a single commit on
main.Tested
Linux (Ubuntu 24.04, GCC 13, Release):
guest_rune_localepasses with--repeat until-fail:3. It now checks everyisw*/iswctypeagainst the narrowis*exports for 0..299 andWEOF, everywctypename and unknown names,towlower/towupperfor 0..299 andWEOF, andbtowc/wctobat EOF, 0, ASCII, 0xE9, negative bytes, 0x100, 0x20AC andWEOF. It fails whenwctobdrops its range check.check_conventions.pypasses. Windows: both files compile with MinGW-w64 GCC 13 (-Wall -Wextra -fsyntax-only); not run on Windows.import_audit.pywith #1781 and this branch, absent imports before → after: PPSA19111 66 → 45, PPSA59322 ccleste 50 → 29, PPSA68091 Ruffle 71 → 50, PPSA97510 74 → 53, PPSA98510 74 → 53, PPSA99002 74 → 53, PPSA99010 vkQuake 51 → 30, PPSA99420 116 → 110, PPSA99728 28 → 26, PPSA99764 80 → 59, PPSA99810 64 → 43. No title run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)