Commit a9c103bc authored by Marc-André Lemburg's avatar Marc-André Lemburg

Added new Py_UNICODE_ISALPHA() and Py_UNICODE_ISALNUM() macros

which are true for alphabetic and alphanumeric characters resp.

The macros are currently implemented using the existing is* tables
but will have to be updated to meet the Unicode standard definitions
(add tables for non-cased letters and letter modifiers).
parent 891bc654
......@@ -160,6 +160,17 @@ typedef unsigned short Py_UNICODE;
#endif
#define Py_UNICODE_ISALPHA(ch) \
(Py_UNICODE_ISLOWER(ch) || \
Py_UNICODE_ISUPPER(ch) || \
Py_UNICODE_ISTITLE(ch))
#define Py_UNICODE_ISALNUM(ch) \
(Py_UNICODE_ISALPHA(ch) || \
Py_UNICODE_ISDECIMAL(ch) || \
Py_UNICODE_ISDIGIT(ch) || \
Py_UNICODE_ISNUMERIC(ch))
#define Py_UNICODE_COPY(target, source, length)\
(memcpy((target), (source), (length)*sizeof(Py_UNICODE)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment