summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2009-04-27 20:54:42 (GMT)
committerEric Smith <eric@trueblade.com>2009-04-27 20:54:42 (GMT)
commit8374981fb4d781d5ddbca313656bd3f32b49cef4 (patch)
tree62ba93c238482fe16e2f797b18bac38de49ca079 /Include
parent6dc46f5eaa14c8aa33b8ae5b41642a00a1b25807 (diff)
downloadcpython-8374981fb4d781d5ddbca313656bd3f32b49cef4.zip
cpython-8374981fb4d781d5ddbca313656bd3f32b49cef4.tar.gz
cpython-8374981fb4d781d5ddbca313656bd3f32b49cef4.tar.bz2
Include files missed in r72044.
Diffstat (limited to 'Include')
-rw-r--r--Include/pyctype.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Include/pyctype.h b/Include/pyctype.h
new file mode 100644
index 0000000..0d211ec
--- /dev/null
+++ b/Include/pyctype.h
@@ -0,0 +1,28 @@
+#ifndef PYCTYPE_H
+#define PYCTYPE_H
+
+#define PY_CTF_LOWER 0x01
+#define PY_CTF_UPPER 0x02
+#define PY_CTF_ALPHA (PY_CTF_LOWER|PY_CTF_UPPER)
+#define PY_CTF_DIGIT 0x04
+#define PY_CTF_ALNUM (PY_CTF_ALPHA|PY_CTF_DIGIT)
+#define PY_CTF_SPACE 0x08
+#define PY_CTF_XDIGIT 0x10
+
+extern const unsigned int _Py_ctype_table[256];
+
+#define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER)
+#define Py_ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER)
+#define Py_ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA)
+#define Py_ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT)
+#define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT)
+#define Py_ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM)
+#define Py_ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE)
+
+extern const unsigned char _Py_ctype_tolower[256];
+extern const unsigned char _Py_ctype_toupper[256];
+
+#define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)])
+#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])
+
+#endif /* !PYCTYPE_H */