Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/localedef/ctype.c
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | case T_ISLOWER: | ||||
break; | break; | ||||
case T_ISALPHA: | case T_ISALPHA: | ||||
ctn->ctype |= (_ISALPHA | _ISGRAPH | _ISPRINT); | ctn->ctype |= (_ISALPHA | _ISGRAPH | _ISPRINT); | ||||
break; | break; | ||||
case T_ISDIGIT: | case T_ISDIGIT: | ||||
ctn->ctype |= (_ISDIGIT | _ISGRAPH | _ISPRINT | _ISXDIGIT | _E4); | ctn->ctype |= (_ISDIGIT | _ISGRAPH | _ISPRINT | _ISXDIGIT | _E4); | ||||
break; | break; | ||||
case T_ISSPACE: | case T_ISSPACE: | ||||
ctn->ctype |= _ISSPACE; | /* | ||||
* This can be troublesome as <form-feed>, <newline>, | |||||
* <carriage-return>, <tab>, and <vertical-tab> are defined both | |||||
* as space and cntrl, and POSIX doesn't allow cntrl/print | |||||
* combination. We will take care of this in dump_ctype(). | |||||
*/ | |||||
ctn->ctype |= (_ISSPACE | _ISPRINT); | |||||
break; | break; | ||||
case T_ISCNTRL: | case T_ISCNTRL: | ||||
ctn->ctype |= _ISCNTRL; | ctn->ctype |= _ISCNTRL; | ||||
break; | break; | ||||
case T_ISGRAPH: | case T_ISGRAPH: | ||||
ctn->ctype |= (_ISGRAPH | _ISPRINT); | ctn->ctype |= (_ISGRAPH | _ISPRINT); | ||||
break; | break; | ||||
case T_ISPRINT: | case T_ISPRINT: | ||||
▲ Show 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | RB_FOREACH(ctn, ctypes, &ctypes) { | ||||
if (ctn->ctype & _ISBLANK) | if (ctn->ctype & _ISBLANK) | ||||
ctn->ctype |= _ISSPACE; | ctn->ctype |= _ISSPACE; | ||||
if (ctn->ctype & (_ISALPHA|_ISDIGIT|_ISXDIGIT)) | if (ctn->ctype & (_ISALPHA|_ISDIGIT|_ISXDIGIT)) | ||||
ctn->ctype |= _ISGRAPH; | ctn->ctype |= _ISGRAPH; | ||||
if (ctn->ctype & _ISGRAPH) | if (ctn->ctype & _ISGRAPH) | ||||
ctn->ctype |= _ISPRINT; | ctn->ctype |= _ISPRINT; | ||||
/* | /* | ||||
* Finally, POSIX requires that certain combinations | * POSIX requires that certain combinations are invalid. | ||||
* are invalid. We don't flag this as a fatal error, | * Try fixing the cases we know about (see add_ctype_impl()). | ||||
* but we will warn about. | */ | ||||
if ((ctn->ctype & (_ISSPACE|_ISCNTRL)) == (_ISSPACE|_ISCNTRL)) | |||||
ctn->ctype &= ~_ISPRINT; | |||||
/* | |||||
* Finally, don't flag remaining cases as a fatal error, | |||||
* and just warn about them. | |||||
*/ | */ | ||||
if ((ctn->ctype & _ISALPHA) && | if ((ctn->ctype & _ISALPHA) && | ||||
(ctn->ctype & (_ISPUNCT|_ISDIGIT))) | (ctn->ctype & (_ISPUNCT|_ISDIGIT))) | ||||
conflict++; | conflict++; | ||||
if ((ctn->ctype & _ISPUNCT) && | if ((ctn->ctype & _ISPUNCT) && | ||||
(ctn->ctype & (_ISDIGIT|_ISALPHA|_ISXDIGIT))) | (ctn->ctype & (_ISDIGIT|_ISALPHA|_ISXDIGIT))) | ||||
conflict++; | conflict++; | ||||
if ((ctn->ctype & _ISSPACE) && (ctn->ctype & _ISGRAPH)) | if ((ctn->ctype & _ISSPACE) && (ctn->ctype & _ISGRAPH)) | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |