]>
Commit | Line | Data |
---|---|---|
c8042e10 DM |
1 | #ifndef PYCTYPE_H\r |
2 | #define PYCTYPE_H\r | |
3 | \r | |
4 | #define PY_CTF_LOWER 0x01\r | |
5 | #define PY_CTF_UPPER 0x02\r | |
6 | #define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER)\r | |
7 | #define PY_CTF_DIGIT 0x04\r | |
8 | #define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT)\r | |
9 | #define PY_CTF_SPACE 0x08\r | |
10 | #define PY_CTF_XDIGIT 0x10\r | |
11 | \r | |
12 | PyAPI_DATA(const unsigned int) _Py_ctype_table[256];\r | |
13 | \r | |
14 | /* Unlike their C counterparts, the following macros are not meant to\r | |
15 | * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument\r | |
16 | * must be a signed/unsigned char. */\r | |
17 | #define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER)\r | |
18 | #define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER)\r | |
19 | #define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA)\r | |
20 | #define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT)\r | |
21 | #define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT)\r | |
22 | #define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM)\r | |
23 | #define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE)\r | |
24 | \r | |
25 | PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256];\r | |
26 | PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256];\r | |
27 | \r | |
28 | #define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)])\r | |
29 | #define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])\r | |
30 | \r | |
31 | #endif /* !PYCTYPE_H */\r |