diff options
| author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2026-03-25 15:12:25 +0200 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2026-04-16 10:42:13 +0100 |
| commit | b9a1b0db1d7d455278611efb1d63c96675b15b67 (patch) | |
| tree | 24cd7ee29e999a2f7abf7bc2b9018ffe73df5ac4 /scripts/embedded_scripts | |
| parent | 797628de79fe79e95da3e783b10a642c6e03c234 (diff) | |
| download | busybox-w32-b9a1b0db1d7d455278611efb1d63c96675b15b67.tar.gz busybox-w32-b9a1b0db1d7d455278611efb1d63c96675b15b67.tar.bz2 busybox-w32-b9a1b0db1d7d455278611efb1d63c96675b15b67.zip | |
win32: add actype/isactype instead of match_class
TL;DR:
- Add actype/isactype, like POSIX wctype/iswctype, but single-byte.
- actype is a renamed match_class, isactype is yet unused.
- This can be used in win32/{fnmatch,regcomp}.c, and elsewhere - tr.c.
Details:
win32/fnmatch.c and win32/regcomp.c used match_class to get char-class
index for char-class name, which is then used in a switch statement to
choose the single-byte isupper, isalpha, etc.
This is analogous to the POSIX wctype/iswctype, except that wctype
returns 0 for unknown name but match_class returned -1.
This commit renames match_class to actype:
- Returns 0 for unknown name, which at the enum is a new CCLASS_NONE.
- Return type is actype_t (still enum), analogous to wctype_t.
- Rename match_class* to actype* at fname/kbuild/includes/usage.
Both fnmatch.c and regcomp.c don't care whether unknown name in
match_class/actype is -1 (match_class) or 0 (actype). All they care
about is the values at each "case".
Also implemented, but not yet used:
- isactype(c, t): test whether char c is of type t.
- isactype_not0(c, t): when t is not-0 - same as isactype but faster.
- actail(s, int*): test for "NAME:]..." without temporary buffer.
Note that this commit focuses on exposing a useful API rather than
performance. Future commits may improve actype/isactype performance.
Diffstat (limited to 'scripts/embedded_scripts')
0 files changed, 0 insertions, 0 deletions
