diff options
Diffstat (limited to 'Include/bytes_methods.h')
-rw-r--r-- | Include/bytes_methods.h | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/Include/bytes_methods.h b/Include/bytes_methods.h index e973261..0938446 100644 --- a/Include/bytes_methods.h +++ b/Include/bytes_methods.h @@ -38,23 +38,15 @@ extern const char _Py_capitalize__doc__[]; extern const char _Py_swapcase__doc__[]; extern const char _Py_maketrans__doc__[]; -#define FLAG_LOWER 0x01 -#define FLAG_UPPER 0x02 -#define FLAG_ALPHA (FLAG_LOWER|FLAG_UPPER) -#define FLAG_DIGIT 0x04 -#define FLAG_ALNUM (FLAG_ALPHA|FLAG_DIGIT) -#define FLAG_SPACE 0x08 -#define FLAG_XDIGIT 0x10 - -extern const unsigned int _Py_ctype_table[256]; - -#define ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_LOWER) -#define ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_UPPER) -#define ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_ALPHA) -#define ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_DIGIT) -#define ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_XDIGIT) -#define ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_ALNUM) -#define ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_SPACE) +/* These are left in for backward compatibility and will be removed + in 2.8/3.2 */ +#define ISLOWER(c) Py_ISLOWER(c) +#define ISUPPER(c) Py_ISUPPER(c) +#define ISALPHA(c) Py_ISALPHA(c) +#define ISDIGIT(c) Py_ISDIGIT(c) +#define ISXDIGIT(c) Py_ISXDIGIT(c) +#define ISALNUM(c) Py_ISALNUM(c) +#define ISSPACE(c) Py_ISSPACE(c) #undef islower #define islower(c) undefined_islower(c) @@ -71,11 +63,10 @@ extern const unsigned int _Py_ctype_table[256]; #undef isspace #define isspace(c) undefined_isspace(c) -extern const unsigned char _Py_ctype_tolower[256]; -extern const unsigned char _Py_ctype_toupper[256]; - -#define TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) -#define TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) +/* These are left in for backward compatibility and will be removed + in 2.8/3.2 */ +#define TOLOWER(c) Py_TOLOWER(c) +#define TOUPPER(c) Py_TOUPPER(c) #undef tolower #define tolower(c) undefined_tolower(c) |