Rev 647 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 647 | Rev 6424 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | ** All character classification functions except isascii(). |
2 | ** All character classification functions except isascii(). |
3 | ** Integer argument (c) must be in ASCII range (0-127) for |
3 | ** Integer argument (c) must be in ASCII range (0-127) for |
4 | ** dependable answers. |
4 | ** dependable answers. |
5 | */ |
5 | */ |
Line 6... | Line 6... | ||
6 | 6 | ||
7 | #define ALNUM 1 |
7 | #define __ALNUM 1 |
8 | #define ALPHA 2 |
8 | #define __ALPHA 2 |
9 | #define CNTRL 4 |
9 | #define __CNTRL 4 |
10 | #define DIGIT 8 |
10 | #define __DIGIT 8 |
11 | #define GRAPH 16 |
11 | #define __GRAPH 16 |
12 | #define LOWER 32 |
12 | #define __LOWER 32 |
13 | #define PRINT 64 |
13 | #define __PRINT 64 |
14 | #define PUNCT 128 |
14 | #define __PUNCT 128 |
15 | #define BLANK 256 |
15 | #define __BLANK 256 |
16 | #define UPPER 512 |
16 | #define __UPPER 512 |
Line 17... | Line 17... | ||
17 | #define XDIGIT 1024 |
17 | #define __XDIGIT 1024 |
Line 18... | Line 18... | ||
18 | 18 | ||
19 | extern char _is[128]; |
19 | extern char __is[128]; |
20 | 20 | ||
21 | #define isalnum(c)(_is[c] & ALNUM ) /* 'a'-'z', 'A'-'Z', '0'-'9' */ |
21 | #define isalnum(c)(__is[c] & __ALNUM ) /* 'a'-'z', 'A'-'Z', '0'-'9' */ |
22 | #define isalpha(c)(_is[c] & ALPHA ) /* 'a'-'z', 'A'-'Z' */ |
22 | #define isalpha(c)(__is[c] & __ALPHA ) /* 'a'-'z', 'A'-'Z' */ |
23 | #define iscntrl(c)(_is[c] & CNTRL ) /* 0-31, 127 */ |
23 | #define iscntrl(c)(__is[c] & __CNTRL ) /* 0-31, 127 */ |
24 | #define isdigit(c)(_is[c] & DIGIT ) /* '0'-'9' */ |
24 | #define isdigit(c)(__is[c] & __DIGIT ) /* '0'-'9' */ |
25 | #define isgraph(c)(_is[c] & GRAPH ) /* '!'-'~' */ |
25 | #define isgraph(c)(__is[c] & __GRAPH ) /* '!'-'~' */ |
26 | #define islower(c)(_is[c] & LOWER ) /* 'a'-'z' */ |
26 | #define islower(c)(__is[c] & __LOWER ) /* 'a'-'z' */ |
27 | #define isprint(c)(_is[c] & PRINT ) /* ' '-'~' */ |
27 | #define isprint(c)(__is[c] & __PRINT ) /* ' '-'~' */ |
28 | #define ispunct(c)(_is[c] & PUNCT ) /* !alnum && !cntrl && !space */ |
28 | #define ispunct(c)(__is[c] & __PUNCT ) /* !alnum && !cntrl && !space */ |
Line 29... | Line 29... | ||
29 | #define isspace(c)(_is[c] & BLANK ) /* HT, LF, VT, FF, CR, ' ' */ |
29 | #define isspace(c)(__is[c] & __BLANK ) /* HT, LF, VT, FF, CR, ' ' */ |
30 | #define isupper(c)(_is[c] & UPPER ) /* 'A'-'Z' */ |
30 | #define isupper(c)(__is[c] & __UPPER ) /* 'A'-'Z' */ |