summaryrefslogtreecommitdiff
path: root/src/ctype
AgeCommit message (Collapse)AuthorFilesLines
2013-12-12include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy4-6/+3
2013-11-11iswspace: fix handling of 0rofl0r1-2/+1
2013-03-04fix types for wctype_t and wctrans_tRich Felker1-4/+4
wctype_t was incorrectly "int" rather than "long" on x86_64. not only is this an ABI incompatibility; it's also a major design flaw if we ever wanted wctype_t to be implemented as a pointer, which would be necessary if locales support custom character classes, since int is too small to store a converted pointer. this commit fixes wctype_t to be unsigned long on all archs, matching the LSB ABI; this change does not matter for C code, but for C++ it affects mangling. the same issue applied to wctrans_t. glibc/LSB defines this type as const __int32_t *, but since no such definition is visible, I've just expanded the definition, int, everywhere. it would be nice if these types (which don't vary by arch) could be in wctype.h, but the OB XSI requirement in POSIX that wchar.h expose some types and functions from wctype.h precludes doing so. glibc works around this with some hideous hacks, but trying to duplicate that would go against the intent of musl's headers.
2013-02-02make some arrays constrofl0r3-4/+4
this way they'll go into .rodata, decreasing memory pressure.
2012-08-02fix argument type error on wcwidth functionRich Felker1-2/+2
since the correct declaration was not visible, and since the representation of the types wchar_t and wint_t always match, a compiler would have to go out of its way to make this bug manifest, but better to fix it anyway.
2012-06-20fix broken wcwidth tablesRich Felker1-7/+8
unicode char data has both "W" and "F" wide types and the old table only included the "W" ones. this omitted U+3000 (ideographic space) and all the wide-ascii, etc.
2012-06-05fix ctype abi junk (pointer should point to 0 slot, not -128 slot)Rich Felker3-3/+3
2012-06-02add LSB abi junk for ctype functionsRich Felker3-0/+104
this should be the last major fix needed to support running glibc-linked conforming POSIX programs with musl in place of glibc, as long as musl provides the features they need and they don't use pthread cancellation (which is implemented as c++ exceptions in glibc, and fundamentally incompatible with musl).
2012-04-24new wcwidth implementation (fast table-based)Rich Felker3-179/+125
i tried to go with improving the old binary-search-based algorithm, but between growth in the number of ranges, bad performance, and lack of confidence in the binary search code's stability under changes in the table, i decided it was worth the extra 1.8k to have something clean and maintainable. also note that, like the alpha and punct tables, there's definitely room to optimize the nonspacing/wide tables by overlapping subtables. this is not a high priority, but i've begun looking into how to do it, and i suspect the table sizes can be roughly halved. if that turns out to be true, the new, fast, table-based implementation will be roughly the same size as if i had just extended the old binary search one.
2012-04-23sync case mappings with unicode 6.1Rich Felker2-8/+30
also special-case ß (U+00DF) as lowercase even though it does not have a mapping to uppercase. unicode added an uppercase version of this character but does not map it, presumably because the uppercase version is not actually used except for some obscure purpose...
2012-04-23optimize iswprintRich Felker1-3/+12
2012-04-23fix spurious punct class for some surrogate codepoints (invalid)Rich Felker1-59/+56
this happened due to their entries in UnicodeData.txt
2012-04-23destubify iswalpha and update iswpunct to unicode 6.1Rich Felker5-135/+252
alpha is defined as unicode property "Alphabetic" plus category Nd minus ASCII digits minus 2 special-cased Thai punctuation marks supposedly misclassified by Unicode as letters. punct is defined as all of unicode except control, alphanumeric, and space characters. the tables were generated by a simple tool based on the code posted previously to the mailing list. in the future, this and other code used for maintaining locale/iconv/i18n data will be published either in the main source repository or in a separate locale data generation repository.
2012-02-09document iswspace and remove wrongly-included zwsp characterRich Felker1-1/+5
2012-02-09fix typo in iswspace space list tableRich Felker1-1/+1
2011-02-14more header fixes, minor warning fixRich Felker1-0/+1
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker34-0/+854