summaryrefslogtreecommitdiffstats
path: root/Include/bytes_methods.h
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2009-04-27 20:39:49 (GMT)
committerEric Smith <eric@trueblade.com>2009-04-27 20:39:49 (GMT)
commit6dc46f5eaa14c8aa33b8ae5b41642a00a1b25807 (patch)
treefc063968e5d131487c7418647e2cf4abf942cdff /Include/bytes_methods.h
parent249b898ec7839cc022d5d0b7638284663a6edfb7 (diff)
downloadcpython-6dc46f5eaa14c8aa33b8ae5b41642a00a1b25807.zip
cpython-6dc46f5eaa14c8aa33b8ae5b41642a00a1b25807.tar.gz
cpython-6dc46f5eaa14c8aa33b8ae5b41642a00a1b25807.tar.bz2
Merged revisions 72040 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72040 | eric.smith | 2009-04-27 15:04:37 -0400 (Mon, 27 Apr 2009) | 1 line Issue #5793: rationalize isdigit / isalpha / tolower, etc. Will port to py3k. Should fix Windows buildbot errors. ........
Diffstat (limited to 'Include/bytes_methods.h')
-rw-r--r--Include/bytes_methods.h35
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)