diff options
author | ache <ache@FreeBSD.org> | 1996-08-11 11:42:03 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-08-11 11:42:03 +0000 |
commit | bef006b8fce691d9a1efce1ebaab499612c07e0f (patch) | |
tree | 56af5c05e41691870a87802f8747246bbf879fad /lib/libc/regex/cclass.h | |
parent | 286a76bdee0819fa63a83d2e2088c601183e7cb7 (diff) | |
download | FreeBSD-src-bef006b8fce691d9a1efce1ebaab499612c07e0f.zip FreeBSD-src-bef006b8fce691d9a1efce1ebaab499612c07e0f.tar.gz |
Use locale for character classes instead of hardcoded values
Misc 8bit cleanup
Diffstat (limited to 'lib/libc/regex/cclass.h')
-rw-r--r-- | lib/libc/regex/cclass.h | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/lib/libc/regex/cclass.h b/lib/libc/regex/cclass.h index cabe7fa..581909c 100644 --- a/lib/libc/regex/cclass.h +++ b/lib/libc/regex/cclass.h @@ -37,34 +37,26 @@ * @(#)cclass.h 8.3 (Berkeley) 3/20/94 */ + +typedef enum {CALNUM, CALPHA, CBLANK, CCNTRL, CDIGIT, CGRAPH, + CLOWER, CPRINT, CPUNCT, CSPACE, CUPPER, CXDIGIT} citype; + /* character-class table */ static struct cclass { char *name; - char *chars; - char *multis; + citype fidx; } cclasses[] = { - {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789", ""}, - {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - ""}, - {"blank", " \t", ""}, - {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", ""}, - {"digit", "0123456789", ""}, - {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"lower", "abcdefghijklmnopqrstuvwxyz", - ""}, - {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - ""}, - {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"space", "\t\n\v\f\r ", ""}, - {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - ""}, - {"xdigit", "0123456789ABCDEFabcdef", - ""}, - {NULL, 0, ""} + {"alnum", CALNUM}, + {"alpha", CALPHA}, + {"blank", CBLANK}, + {"cntrl", CCNTRL}, + {"digit", CDIGIT}, + {"graph", CGRAPH}, + {"lower", CLOWER}, + {"print", CPRINT}, + {"punct", CPUNCT}, + {"space", CSPACE}, + {"upper", CUPPER}, + {"xdigit", CXDIGIT}, + {NULL, } }; |