diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-07 22:22:16 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-07 22:22:16 +0100 |
| commit | 8f9e448b2ef6db7cd905540c21f3c5b190e7a1e7 (patch) | |
| tree | ae0285dd15042d1e9236a5ce2e60daf65acbdca0 /lib/libc/wctype | |
| parent | fc00c656c96528112d05cf0edf8631bd5eaea446 (diff) | |
Add bin/true and bin/false implementations
- Added assembly implementations for `true` and `false` commands.
- Updated Kbuild files to include new binaries.
- Removed unused libraries and headers.
- Cleaned up makefile and unused code.
Diffstat (limited to 'lib/libc/wctype')
| -rw-r--r-- | lib/libc/wctype/iswalnum.c | 12 | ||||
| -rw-r--r-- | lib/libc/wctype/iswalpha.c | 22 | ||||
| -rw-r--r-- | lib/libc/wctype/iswblank.c | 13 | ||||
| -rw-r--r-- | lib/libc/wctype/iswdigit.c | 12 | ||||
| -rw-r--r-- | lib/libc/wctype/iswgraph.c | 12 | ||||
| -rw-r--r-- | lib/libc/wctype/iswlower.c | 12 | ||||
| -rw-r--r-- | lib/libc/wctype/iswprint.c | 14 | ||||
| -rw-r--r-- | lib/libc/wctype/iswpunct.c | 327 | ||||
| -rw-r--r-- | lib/libc/wctype/iswspace.c | 20 | ||||
| -rw-r--r-- | lib/libc/wctype/iswupper.c | 12 | ||||
| -rw-r--r-- | lib/libc/wctype/iswxdigit.c | 12 | ||||
| -rw-r--r-- | lib/libc/wctype/towctrans.c | 348 | ||||
| -rw-r--r-- | lib/libc/wctype/wctype.c | 32 |
13 files changed, 0 insertions, 848 deletions
diff --git a/lib/libc/wctype/iswalnum.c b/lib/libc/wctype/iswalnum.c deleted file mode 100644 index 3eb2f14f..00000000 --- a/lib/libc/wctype/iswalnum.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswalnum(wint_t wc) -{ - return iswdigit(wc) || iswalpha(wc); -} - -weak int iswalnum_l(wint_t wc, locale_t unused locale) -{ - return iswalnum(wc); -} diff --git a/lib/libc/wctype/iswalpha.c b/lib/libc/wctype/iswalpha.c deleted file mode 100644 index 17c8508c..00000000 --- a/lib/libc/wctype/iswalpha.c +++ /dev/null @@ -1,22 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswalpha(wint_t wc) -{ - const unsigned char t[] = { -#include <__alpha.h> - }; - - if (wc < 0x20000U) - return (t[t[wc >> 8] * 32 + ((wc & 255) >> 3)] >> (wc & 7)) & 1; - - if (wc < 0x2fffeU) - return 1; - - return 0; -} - -weak int iswalpha_l(wint_t wc, locale_t unused locale) -{ - return iswalpha(wc); -} diff --git a/lib/libc/wctype/iswblank.c b/lib/libc/wctype/iswblank.c deleted file mode 100644 index 61664162..00000000 --- a/lib/libc/wctype/iswblank.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <libc.h> -#include <wctype.h> -#include <ctype.h> - -int iwsblank(wint_t wc) -{ - return isblank((unsigned char)wc); -} - -weak int iswblank_l(wint_t c, locale_t unused locale) -{ - return iswblank(c); -} diff --git a/lib/libc/wctype/iswdigit.c b/lib/libc/wctype/iswdigit.c deleted file mode 100644 index e775f561..00000000 --- a/lib/libc/wctype/iswdigit.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswdigit(wint_t wc) -{ - return (wc >= L'0' && wc <= L'9'); -} - -weak int iswdigit_l(wint_t wc, locale_t unused locale) -{ - return iswdigit(wc); -} diff --git a/lib/libc/wctype/iswgraph.c b/lib/libc/wctype/iswgraph.c deleted file mode 100644 index 00ab6cca..00000000 --- a/lib/libc/wctype/iswgraph.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswgraph(wint_t wc) -{ - return iswprint(wc) && !iswspace(wc); -} - -weak int iswgraph_l(wint_t wc, locale_t unused locale) -{ - return iswgraph(wc); -} diff --git a/lib/libc/wctype/iswlower.c b/lib/libc/wctype/iswlower.c deleted file mode 100644 index dea58f3a..00000000 --- a/lib/libc/wctype/iswlower.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswlower(wint_t wc) -{ - return towupper(wc) != wc; -} - -weak int islower_l(wint_t wc, locale_t unused locale) -{ - return iswlower(wc); -} diff --git a/lib/libc/wctype/iswprint.c b/lib/libc/wctype/iswprint.c deleted file mode 100644 index f0b26fbf..00000000 --- a/lib/libc/wctype/iswprint.c +++ /dev/null @@ -1,14 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswprint(wint_t wc) -{ - return (wc >= 0x20 && wc <= 0x7E) || - (wc >= 0xA0 && wc <= 0x10FFFF && (wc < 0xFDD0 || wc > 0xFDEF) && - (wc & 0xFFFE) != 0xFFFE); -} - -weak int iswprint_l(wint_t wc, locale_t unused locale) -{ - return iswprint(wc); -} diff --git a/lib/libc/wctype/iswpunct.c b/lib/libc/wctype/iswpunct.c deleted file mode 100644 index d7ed6487..00000000 --- a/lib/libc/wctype/iswpunct.c +++ /dev/null @@ -1,327 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswpunct(wint_t wc) -{ - const unsigned char t[] = { - 18, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 16, 16, 34, 35, 16, 36, 37, 38, 39, - 40, 41, 42, 43, 16, 44, 45, 46, 17, 17, 47, 17, 17, - 17, 17, 17, 17, 48, 49, 50, 51, 52, 53, 54, 55, 17, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 56, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 57, 16, 58, 59, 60, - 61, 62, 63, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 64, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 65, 16, 16, 66, 16, 67, 68, 69, 16, 70, 71, 72, - 16, 73, 16, 16, 74, 75, 76, 77, 78, 16, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 16, 92, 93, - 94, 95, 16, 16, 16, 16, 96, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 97, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 98, 99, - 16, 16, 100, 101, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 102, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 103, 104, 105, 106, - 16, 16, 107, 108, 17, 17, 109, 16, 16, 16, 16, 16, 16, - 110, 111, 16, 16, 16, 16, 16, 112, 113, 16, 16, 114, 115, - 116, 16, 117, 118, 119, 17, 17, 17, 120, 121, 122, 123, 124, - 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 0, 0, 0, 0, 254, 255, 0, 252, 1, - 0, 0, 248, 1, 0, 0, 120, 0, 0, 0, 0, 255, 251, - 223, 251, 0, 0, 128, 0, 0, 0, 128, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 252, 255, 224, - 175, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 223, 255, - 255, 255, 255, 255, 32, 64, 176, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 252, 0, 0, 0, 0, 0, 230, 254, 255, 255, 255, 0, 64, - 73, 0, 0, 0, 0, 0, 24, 0, 255, 255, 0, 216, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, 224, 1, 30, 0, - 96, 255, 191, 0, 0, 0, 0, 0, 0, 255, 7, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 248, 207, 227, 0, 0, 0, 3, 0, 32, - 255, 127, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 8, 0, 7, 252, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 16, 0, 32, 30, 0, 48, - 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 32, - 0, 0, 0, 0, 252, 111, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 32, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, - 0, 0, 0, 16, 0, 32, 0, 0, 0, 0, 3, 224, 0, - 0, 0, 0, 0, 0, 0, 16, 0, 32, 0, 0, 0, 0, - 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, - 0, 0, 0, 255, 7, 16, 0, 0, 0, 0, 0, 0, 0, - 0, 32, 0, 0, 0, 0, 128, 255, 16, 0, 0, 0, 0, - 0, 0, 16, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 24, 0, 160, 0, 127, 0, 0, 255, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, - 0, 0, 16, 0, 0, 0, 0, 0, 0, 128, 0, 128, 192, - 223, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 4, 0, 31, 0, 0, 0, 0, 0, 0, 254, 255, 255, - 255, 0, 252, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, - 252, 0, 0, 0, 0, 0, 0, 192, 255, 223, 255, 7, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 6, 0, 252, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 224, 255, 255, 255, 31, 0, - 0, 255, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 1, 0, - 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, - 0, 0, 0, 16, 0, 0, 0, 112, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, - 254, 127, 47, 0, 0, 255, 3, 255, 127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 49, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 196, 255, 255, 255, 255, 0, 0, 0, 192, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 224, 159, 0, 0, 0, 0, - 127, 63, 255, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 16, 0, 16, 0, 0, 252, 255, 255, - 255, 31, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, - 0, 64, 0, 12, 240, 0, 0, 0, 0, 0, 0, 128, 248, - 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 0, 255, 255, 255, 33, 144, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, - 127, 0, 224, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 160, 3, 224, 0, 224, 0, 224, 0, 96, 128, 248, 255, - 255, 255, 252, 255, 255, 255, 255, 255, 127, 223, 255, 241, 127, - 255, 127, 0, 0, 255, 255, 255, 255, 0, 0, 255, 255, 255, - 255, 1, 0, 123, 3, 208, 193, 175, 66, 0, 12, 31, 188, - 255, 255, 0, 0, 0, 0, 0, 14, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 127, 0, 0, 0, 255, 7, 0, 0, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 63, 0, 0, 0, 0, 0, 0, 252, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 207, 255, 255, 255, 63, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 135, 3, - 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 127, - 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 255, - 251, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 15, 0, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 63, 0, 0, 0, 255, 15, 30, 255, 255, 255, 1, 252, 193, - 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 255, 255, 255, - 255, 15, 0, 0, 0, 255, 255, 255, 127, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, - 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, - 255, 255, 127, 0, 0, 0, 0, 0, 0, 192, 0, 224, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 15, 112, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 0, 255, 255, 127, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, - 0, 15, 255, 3, 0, 0, 0, 0, 0, 0, 240, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 16, 192, 0, 0, 255, 255, - 3, 23, 0, 0, 0, 0, 0, 248, 0, 0, 0, 0, 8, - 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, - 255, 63, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 240, 0, 0, 128, 3, 0, 0, - 0, 0, 0, 0, 0, 128, 2, 0, 0, 192, 0, 0, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 252, 255, 3, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 48, 255, 255, 255, 3, 255, 255, 255, 255, - 255, 255, 247, 255, 127, 15, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 254, 255, - 0, 252, 1, 0, 0, 248, 1, 0, 0, 248, 63, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 127, 127, 0, 48, 135, 255, 255, 255, 255, 255, 143, 255, 0, - 0, 0, 0, 0, 0, 224, 255, 255, 127, 255, 15, 1, 0, - 0, 0, 0, 0, 255, 255, 255, 255, 255, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, - 255, 255, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, - 255, 0, 0, 128, 255, 0, 0, 0, 0, 128, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 248, 0, 0, 192, 143, 0, - 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 48, 255, 255, 252, 255, 255, 255, 255, - 255, 0, 0, 0, 0, 0, 0, 0, 135, 255, 1, 255, 1, - 0, 0, 0, 224, 0, 0, 0, 224, 0, 0, 0, 0, 0, - 1, 0, 0, 96, 248, 127, 0, 0, 0, 0, 0, 0, 0, - 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, - 30, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 252, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, 127, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 224, 127, 0, 0, 0, 192, 255, 255, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 192, 63, 252, 255, 63, 0, 0, 128, 3, 0, 0, 0, 0, - 0, 0, 254, 3, 32, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 24, 0, 15, 0, 0, 0, 0, 0, 56, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, 63, 0, 232, - 254, 255, 31, 0, 0, 0, 0, 0, 0, 0, 96, 63, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 24, 0, 32, 0, 0, 192, 31, 31, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 248, - 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 128, 255, 255, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 14, 0, 0, - 0, 255, 31, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 252, 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 24, 128, 255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 223, 7, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 128, 62, 0, 0, 252, 255, 31, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, - 255, 255, 3, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, - 0, 0, 255, 255, 48, 0, 0, 248, 3, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 176, 15, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 63, 0, - 255, 255, 255, 255, 127, 254, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 1, 0, 0, 255, 255, 255, 255, 255, 255, 255, - 255, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 15, 0, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 0, 255, 255, - 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 8, 0, 0, 0, 8, 0, 0, - 32, 0, 0, 0, 32, 0, 0, 128, 0, 0, 0, 128, 0, - 0, 0, 2, 0, 0, 0, 2, 0, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 15, 0, 248, 254, 255, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 127, 0, 0, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 240, 0, 128, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 128, 255, 127, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 7, 0, - 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 255, 255, 255, - 255, 255, 255, 255, 31, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 254, 255, 255, 255, 255, 255, 255, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, - 255, 255, 255, 255, 255, 15, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 15, 0, 255, 127, 254, 255, 254, 255, - 254, 255, 255, 255, 63, 0, 255, 31, 255, 255, 255, 255, 0, - 0, 0, 252, 0, 0, 0, 28, 0, 0, 0, 252, 255, 255, - 255, 31, 0, 0, 0, 0, 0, 0, 192, 255, 255, 255, 7, - 0, 255, 255, 255, 255, 255, 15, 255, 1, 3, 0, 63, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 63, 0, 255, 31, 255, 7, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 15, - 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 1, - 255, 15, 0, 0, 255, 15, 255, 255, 255, 255, 255, 255, 255, - 0, 255, 3, 255, 255, 255, 255, 255, 0, 255, 255, 255, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 239, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 123, 252, - 255, 255, 255, 255, 231, 199, 255, 255, 255, 231, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 15, 0, 255, 63, 15, 7, 7, 0, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - - }; - - if (wc < 0x20000U) - return (t[t[wc >> 8] * 32 + ((wc & 255) >> 3)] >> (wc & 7)) & 1; - - return 0; -} - -weak int iswctype_l(wint_t wc, wctype_t charclass, locale_t unused locale) -{ - return iswctype(wc, charclass); -} diff --git a/lib/libc/wctype/iswspace.c b/lib/libc/wctype/iswspace.c deleted file mode 100644 index 3b6806af..00000000 --- a/lib/libc/wctype/iswspace.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <libc.h> -#include <wchar.h> -#include <wctype.h> - -int iswspace(wint_t wc) -{ - const wchar_t t[] = { L' ', L'\t', L'\n', L'\r', 11, 12, - 0x0085, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, - 0x2005, 0x2006, 0x2008, 0x2009, 0x200a, 0x2028, - 0x2029, 0x205f, 0x3000, 0 - - }; - - return wc && wcschr(t, (wchar_t)wc) != NULL; -} - -weak int iswspace_l(wint_t wc, locale_t unused locale) -{ - return iswspace(wc); -} diff --git a/lib/libc/wctype/iswupper.c b/lib/libc/wctype/iswupper.c deleted file mode 100644 index afe12049..00000000 --- a/lib/libc/wctype/iswupper.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswupper(wint_t wc) -{ - return towlower(wc) != wc; -} - -weak int iswupper_l(wint_t wc, locale_t unused locale) -{ - return iswupper(wc); -} diff --git a/lib/libc/wctype/iswxdigit.c b/lib/libc/wctype/iswxdigit.c deleted file mode 100644 index fae88730..00000000 --- a/lib/libc/wctype/iswxdigit.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <libc.h> -#include <wctype.h> - -int iswxdigit(wint_t wc) -{ - return (unsigned)(wc - '0') < 10 || (unsigned)((wc | 32) - 'a') < 6; -} - -weak int iswxdigit_l(wint_t wc, locale_t unused locale) -{ - return iswxdigit(wc); -} diff --git a/lib/libc/wctype/towctrans.c b/lib/libc/wctype/towctrans.c deleted file mode 100644 index 9e7f3b63..00000000 --- a/lib/libc/wctype/towctrans.c +++ /dev/null @@ -1,348 +0,0 @@ -#include <libc.h> -#include <ctype.h> -#include <string.h> -#include <wchar.h> -#include <wctype.h> - -/* From embeddedartistry/libc */ -#define CASEMAP(u1, u2, l) { (u1), (l) - (u1), (u2) - (u1) + 1 } -#define CASELACE(u1, u2) CASEMAP((u1), (u2), (u1) + 1) - -static const struct { - unsigned short upper; - signed char lower; - unsigned char len; -} casemaps[] = { - CASEMAP(0xc0, 0xde, 0xe0), - - CASELACE(0x0100, 0x012e), CASELACE(0x0132, 0x0136), - CASELACE(0x0139, 0x0147), CASELACE(0x014a, 0x0176), - CASELACE(0x0179, 0x017d), - - CASELACE(0x370, 0x372), CASEMAP(0x391, 0x3a1, 0x3b1), - CASEMAP(0x3a3, 0x3ab, 0x3c3), CASEMAP(0x400, 0x40f, 0x450), - CASEMAP(0x410, 0x42f, 0x430), - - CASELACE(0x460, 0x480), CASELACE(0x48a, 0x4be), - CASELACE(0x4c1, 0x4cd), CASELACE(0x4d0, 0x50e), - - CASELACE(0x514, 0x52e), CASEMAP(0x531, 0x556, 0x561), - - CASELACE(0x01a0, 0x01a4), CASELACE(0x01b3, 0x01b5), - CASELACE(0x01cd, 0x01db), CASELACE(0x01de, 0x01ee), - CASELACE(0x01f8, 0x021e), CASELACE(0x0222, 0x0232), - CASELACE(0x03d8, 0x03ee), - - CASELACE(0x1e00, 0x1e94), CASELACE(0x1ea0, 0x1efe), - - CASEMAP(0x1f08, 0x1f0f, 0x1f00), CASEMAP(0x1f18, 0x1f1d, 0x1f10), - CASEMAP(0x1f28, 0x1f2f, 0x1f20), CASEMAP(0x1f38, 0x1f3f, 0x1f30), - CASEMAP(0x1f48, 0x1f4d, 0x1f40), - - CASEMAP(0x1f68, 0x1f6f, 0x1f60), CASEMAP(0x1f88, 0x1f8f, 0x1f80), - CASEMAP(0x1f98, 0x1f9f, 0x1f90), CASEMAP(0x1fa8, 0x1faf, 0x1fa0), - CASEMAP(0x1fb8, 0x1fb9, 0x1fb0), CASEMAP(0x1fba, 0x1fbb, 0x1f70), - CASEMAP(0x1fc8, 0x1fcb, 0x1f72), CASEMAP(0x1fd8, 0x1fd9, 0x1fd0), - CASEMAP(0x1fda, 0x1fdb, 0x1f76), CASEMAP(0x1fe8, 0x1fe9, 0x1fe0), - CASEMAP(0x1fea, 0x1feb, 0x1f7a), CASEMAP(0x1ff8, 0x1ff9, 0x1f78), - CASEMAP(0x1ffa, 0x1ffb, 0x1f7c), - - CASEMAP(0x13f0, 0x13f5, 0x13f8), CASELACE(0xa698, 0xa69a), - CASELACE(0xa796, 0xa79e), - - CASELACE(0x246, 0x24e), CASELACE(0x510, 0x512), - CASEMAP(0x2160, 0x216f, 0x2170), CASEMAP(0x2c00, 0x2c2e, 0x2c30), - CASELACE(0x2c67, 0x2c6b), CASELACE(0x2c80, 0x2ce2), - CASELACE(0x2ceb, 0x2ced), - - CASELACE(0xa640, 0xa66c), CASELACE(0xa680, 0xa696), - - CASELACE(0xa722, 0xa72e), CASELACE(0xa732, 0xa76e), - CASELACE(0xa779, 0xa77b), CASELACE(0xa77e, 0xa786), - - CASELACE(0xa790, 0xa792), CASELACE(0xa7a0, 0xa7a8), - - CASELACE(0xa7b4, 0xa7b6), - - CASEMAP(0xff21, 0xff3a, 0xff41), { 0, 0, 0 } -}; - -static const unsigned short pairs[][2] = { { 'I', 0x0131 }, - { 'S', 0x017f }, - { 0x0130, 'i' }, - { 0x0178, 0x00ff }, - { 0x0181, 0x0253 }, - { 0x0182, 0x0183 }, - { 0x0184, 0x0185 }, - { 0x0186, 0x0254 }, - { 0x0187, 0x0188 }, - { 0x0189, 0x0256 }, - { 0x018a, 0x0257 }, - { 0x018b, 0x018c }, - { 0x018e, 0x01dd }, - { 0x018f, 0x0259 }, - { 0x0190, 0x025b }, - { 0x0191, 0x0192 }, - { 0x0193, 0x0260 }, - { 0x0194, 0x0263 }, - { 0x0196, 0x0269 }, - { 0x0197, 0x0268 }, - { 0x0198, 0x0199 }, - { 0x019c, 0x026f }, - { 0x019d, 0x0272 }, - { 0x019f, 0x0275 }, - { 0x01a6, 0x0280 }, - { 0x01a7, 0x01a8 }, - { 0x01a9, 0x0283 }, - { 0x01ac, 0x01ad }, - { 0x01ae, 0x0288 }, - { 0x01af, 0x01b0 }, - { 0x01b1, 0x028a }, - { 0x01b2, 0x028b }, - { 0x01b7, 0x0292 }, - { 0x01b8, 0x01b9 }, - { 0x01bc, 0x01bd }, - { 0x01c4, 0x01c6 }, - { 0x01c4, 0x01c5 }, - { 0x01c5, 0x01c6 }, - { 0x01c7, 0x01c9 }, - { 0x01c7, 0x01c8 }, - { 0x01c8, 0x01c9 }, - { 0x01ca, 0x01cc }, - { 0x01ca, 0x01cb }, - { 0x01cb, 0x01cc }, - { 0x01f1, 0x01f3 }, - { 0x01f1, 0x01f2 }, - { 0x01f2, 0x01f3 }, - { 0x01f4, 0x01f5 }, - { 0x01f6, 0x0195 }, - { 0x01f7, 0x01bf }, - { 0x0220, 0x019e }, - { 0x0386, 0x03ac }, - { 0x0388, 0x03ad }, - { 0x0389, 0x03ae }, - { 0x038a, 0x03af }, - { 0x038c, 0x03cc }, - { 0x038e, 0x03cd }, - { 0x038f, 0x03ce }, - { 0x0399, 0x0345 }, - { 0x0399, 0x1fbe }, - { 0x03a3, 0x03c2 }, - { 0x03f7, 0x03f8 }, - { 0x03fa, 0x03fb }, - { 0x1e60, 0x1e9b }, - { 0x1e9e, 0xdf }, - - { 0x1f59, 0x1f51 }, - { 0x1f5b, 0x1f53 }, - { 0x1f5d, 0x1f55 }, - { 0x1f5f, 0x1f57 }, - { 0x1fbc, 0x1fb3 }, - { 0x1fcc, 0x1fc3 }, - { 0x1fec, 0x1fe5 }, - { 0x1ffc, 0x1ff3 }, - - { 0x23a, 0x2c65 }, - { 0x23b, 0x23c }, - { 0x23d, 0x19a }, - { 0x23e, 0x2c66 }, - { 0x241, 0x242 }, - { 0x243, 0x180 }, - { 0x244, 0x289 }, - { 0x245, 0x28c }, - { 0x3f4, 0x3b8 }, - { 0x3f9, 0x3f2 }, - { 0x3fd, 0x37b }, - { 0x3fe, 0x37c }, - { 0x3ff, 0x37d }, - { 0x4c0, 0x4cf }, - - { 0x2126, 0x3c9 }, - { 0x212a, 'k' }, - { 0x212b, 0xe5 }, - { 0x2132, 0x214e }, - { 0x2183, 0x2184 }, - { 0x2c60, 0x2c61 }, - { 0x2c62, 0x26b }, - { 0x2c63, 0x1d7d }, - { 0x2c64, 0x27d }, - { 0x2c6d, 0x251 }, - { 0x2c6e, 0x271 }, - { 0x2c6f, 0x250 }, - { 0x2c70, 0x252 }, - { 0x2c72, 0x2c73 }, - { 0x2c75, 0x2c76 }, - { 0x2c7e, 0x23f }, - { 0x2c7f, 0x240 }, - { 0x2cf2, 0x2cf3 }, - - { 0xa77d, 0x1d79 }, - { 0xa78b, 0xa78c }, - { 0xa78d, 0x265 }, - { 0xa7aa, 0x266 }, - - { 0x10c7, 0x2d27 }, - { 0x10cd, 0x2d2d }, - - /* bogus greek 'symbol' letters */ - { 0x376, 0x377 }, - { 0x39c, 0xb5 }, - { 0x392, 0x3d0 }, - { 0x398, 0x3d1 }, - { 0x3a6, 0x3d5 }, - { 0x3a0, 0x3d6 }, - { 0x39a, 0x3f0 }, - { 0x3a1, 0x3f1 }, - { 0x395, 0x3f5 }, - { 0x3cf, 0x3d7 }, - - { 0xa7ab, 0x25c }, - { 0xa7ac, 0x261 }, - { 0xa7ad, 0x26c }, - { 0xa7ae, 0x26a }, - { 0xa7b0, 0x29e }, - { 0xa7b1, 0x287 }, - { 0xa7b2, 0x29d }, - { 0xa7b3, 0xab53 }, - - /* special cyrillic lowercase forms - */ - { 0x412, 0x1c80 }, - { 0x414, 0x1c81 }, - { 0x41e, 0x1c82 }, - { 0x421, 0x1c83 }, - { 0x422, 0x1c84 }, - { 0x422, 0x1c85 }, - { 0x42a, 0x1c86 }, - { 0x462, 0x1c87 }, - { 0xa64a, 0x1c88 }, - - { 0, 0 } }; - -wchar_t __towcase(wchar_t wc, int lower) -{ - int i; - int lmul = 2 * lower - 1; - int lmask = lower - 1; - /* no letters with case in these large ranges */ - if (!iswalpha((wint_t)wc) || (unsigned)wc - 0x0600 <= 0x0fff - 0x0600 || - (unsigned)wc - 0x2e00 <= 0xa63f - 0x2e00 || - (unsigned)wc - 0xa800 <= 0xab52 - 0xa800 || - (unsigned)wc - 0xabc0 <= 0xfeff - 0xabc0) { - return wc; - } - - /* special case because the diff between upper/lower is too big */ - if (lower && (unsigned)wc - 0x10a0 < 0x2e) { - if (wc > 0x10c5 && wc != 0x10c7 && wc != 0x10cd) { - return wc; - } - - return wc + 0x2d00 - 0x10a0; - } - - if (!lower && (unsigned)wc - 0x2d00 < 0x26) { - if (wc > 0x2d25 && wc != 0x2d27 && wc != 0x2d2d) { - return wc; - } - - return wc + 0x10a0 - 0x2d00; - } - - if (lower && (unsigned)wc - 0x13a0 < 0x50) { - return wc + 0xab70 - 0x13a0; - } - - if (!lower && (unsigned)wc - 0xab70 < 0x50) { - return wc + 0x13a0 - 0xab70; - } - - for (i = 0; casemaps[i].len; i++) { - int base = casemaps[i].upper + (lmask & casemaps[i].lower); - if (wc - (wchar_t)base < casemaps[i].len) { - if (casemaps[i].lower == 1) { - return wc + (wchar_t)lower - - ((wc - casemaps[i].upper) & 1); - } - return wc + (wchar_t)(lmul * casemaps[i].lower); - } - } - - for (i = 0; pairs[i][1 - lower]; i++) { - if (pairs[i][1 - lower] == wc) { - return pairs[i][lower]; - } - } - - if (wc - (wchar_t)(0x10428 - 0x28 * lower) < 0x28) { - return wc - (wchar_t)(0x28 + 0x50 * lower); - } - - if (wc - (wchar_t)(0x104d8 - 0x28 * lower) < 0x24) { - return wc - (wchar_t)(0x28 + 0x50 * lower); - } - - if (wc - (wchar_t)(0x10cc0 - 0x40 * lower) < 0x33) { - return wc - (wchar_t)(0x40 + 0x80 * lower); - } - - if (wc - (wchar_t)(0x118c0 - 0x20 * lower) < 0x20) { - return wc - (wchar_t)(0x20 + 0x40 * lower); - } - - if (wc - (wchar_t)(0x1e922 - 0x22 * lower) < 0x22) { - return wc - (wchar_t)(0x22 + 0x44 * lower); - } - - return wc; -} - -wint_t towlower(wint_t wc) -{ - return (wint_t)(wc < 128 ? (wint_t)tolower((int)wc) : - (wint_t)__towcase((wchar_t)wc, 1)); -} - -weak wint_t towlower_l(wint_t wc, locale_t unused locale) -{ - return towlower(wc); -} - -wint_t towupper(wint_t wc) -{ - return (wint_t)(wc < 128 ? (wint_t)toupper((int)wc) : - (wint_t)__towcase((wchar_t)wc, 0)); -} - -weak wint_t towupper_l(wint_t wc, locale_t unused locale) -{ - return towupper(wc); -} - -wctrans_t wctrans(const char *class) -{ - if (!strcmp(class, "toupper")) - return (wctrans_t)1; - if (!strcmp(class, "tolower")) - return (wctrans_t)2; - return 0; -} - -weak wctrans_t wctrans_l(const char *class, locale_t unused locale) -{ - return wctrans(class); -} - -wint_t towctrans(wint_t wc, wctrans_t desc) -{ - if (desc == (wctrans_t)1) - return towupper(wc); - if (desc == (wctrans_t)2) - return towlower(wc); - return wc; -} - -weak wint_t towctrans_l(wint_t wc, wctrans_t desc, locale_t unused locale) -{ - return towctrans(wc, desc); -} diff --git a/lib/libc/wctype/wctype.c b/lib/libc/wctype/wctype.c deleted file mode 100644 index 0495ba8c..00000000 --- a/lib/libc/wctype/wctype.c +++ /dev/null @@ -1,32 +0,0 @@ -#include <libc.h> -#include <wctype.h> -#include <string.h> - -wctype_t wctype(const char *property) -{ - int i; - const char *ptr; - static const char n[] = "alnum\0" - "alpha\0" - "blank\0" - "cntrl\0" - "digit\0" - "graph\0" - "lower\0" - "print\0" - "punct\0" - "space\0" - "upper\0" - "xdigit"; - - for (i = 1, ptr = n; *ptr; i++, ptr += strlen(ptr) + 1) - if (!strcmp(property, ptr)) - return i; - - return 0; -} - -weak wctype_t wctype_l(const char *property, locale_t unused locale) -{ - return wctype(property); -} |
