]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Include/pyctype.h
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 1/5.
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Include / pyctype.h
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Include/pyctype.h b/AppPkg/Applications/Python/Python-2.7.10/Include/pyctype.h
new file mode 100644 (file)
index 0000000..e28542a
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef PYCTYPE_H\r
+#define PYCTYPE_H\r
+\r
+#define PY_CTF_LOWER  0x01\r
+#define PY_CTF_UPPER  0x02\r
+#define PY_CTF_ALPHA  (PY_CTF_LOWER|PY_CTF_UPPER)\r
+#define PY_CTF_DIGIT  0x04\r
+#define PY_CTF_ALNUM  (PY_CTF_ALPHA|PY_CTF_DIGIT)\r
+#define PY_CTF_SPACE  0x08\r
+#define PY_CTF_XDIGIT 0x10\r
+\r
+PyAPI_DATA(const unsigned int) _Py_ctype_table[256];\r
+\r
+/* Unlike their C counterparts, the following macros are not meant to\r
+ * handle an int with any of the values [EOF, 0-UCHAR_MAX]. The argument\r
+ * must be a signed/unsigned char. */\r
+#define Py_ISLOWER(c)  (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER)\r
+#define Py_ISUPPER(c)  (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_UPPER)\r
+#define Py_ISALPHA(c)  (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALPHA)\r
+#define Py_ISDIGIT(c)  (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_DIGIT)\r
+#define Py_ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_XDIGIT)\r
+#define Py_ISALNUM(c)  (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_ALNUM)\r
+#define Py_ISSPACE(c)  (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_SPACE)\r
+\r
+PyAPI_DATA(const unsigned char) _Py_ctype_tolower[256];\r
+PyAPI_DATA(const unsigned char) _Py_ctype_toupper[256];\r
+\r
+#define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)])\r
+#define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])\r
+\r
+#endif /* !PYCTYPE_H */\r