Summary: | isspecial(3) is not helpful | ||
---|---|---|---|
Product: | Documentation | Reporter: | Poul-Henning Kamp <phk> |
Component: | Manual Pages | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Open --- | ||
Severity: | Affects Only Me | CC: | doc, emaste, yuripv |
Priority: | Normal | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
Poul-Henning Kamp
2011-05-10 08:40:06 UTC
State Changed From-To: open->analyzed State Changed From-To: analyzed->open unowned PRs should not be in analyzed For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped There doesn't seem to be a definitive description of "special" class anywhere. Given that special class is non-standard extension (even if legacy one), and the fact that it's NOT used in the tree, I'm thinking that it would be best to just undocument it to prevent further confusion and use. (In reply to Yuri Pankov from comment #4) I wonder if we should request an exp-run with it removed, and just take it out if nothing in ports uses it either? #define isspecial(c) __sbistype((c), _CTYPE_T) Whatever that means. @Ed, there are a host of other BSD-specific ctype.h extensions that could maybe be better defined, or removed: 127-#if __BSD_VISIBLE 128-#define digittoint(c) __sbmaskrune((c), 0xFF) 129-#define ishexnumber(c) __sbistype((c), _CTYPE_X) 130-#define isideogram(c) __sbistype((c), _CTYPE_I) 131-#define isnumber(c) __sbistype((c), _CTYPE_D|_CTYPE_N) 132-#define isphonogram(c) __sbistype((c), _CTYPE_Q) 133-#define isrune(c) __sbistype((c), 0xFFFFFF00L) (And keep in mind the corresponding wchar versions, 116-#if __BSD_VISIBLE 117-#define iswascii(wc) (((wc) & ~0x7F) == 0) 118-#define iswhexnumber(wc) __istype((wc), _CTYPE_X) /* alias of iswxdigit */ 119-#define iswideogram(wc) __istype((wc), _CTYPE_I) 120-#define iswnumber(wc) __istype((wc), _CTYPE_D|_CTYPE_N) 121-#define iswphonogram(wc) __istype((wc), _CTYPE_Q) 122-#define iswrune(wc) __istype((wc), 0xFFFFFF00L) 123:#define iswspecial(wc) __istype((wc), _CTYPE_T) ) There is a hardcoded ASCII table in lib/libc/locale/table.c that includes several characters marked as whitespace (_CTYPE_S) but zero references to _CTYPE_T. Similarly, share/ctypedef/C.UTF-8.src declares several classes (alpha, upper, lower, cntrl, digit, "graph", punct) but no "special." (This may be an artifact of tools/tools/locale/tools/utf8-rollup.pl, but it's unclear what was intended by isspecial(). Someone could do some CSRG archaeology to discover the original intent, but it seems defunct now.) |