[Python-checkins] CVS: python/dist/src/Include unicodeobject.h,2.10,2.11

M.-A. Lemburg python-dev@python.org
Mon, 3 Jul 2000 03:52:16 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory slayer.i.sourceforge.net:/tmp/cvs-serv8276/Include

Modified Files:
	unicodeobject.h 
Log Message:
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).

Index: unicodeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.10
retrieving revision 2.11
diff -C2 -r2.10 -r2.11
*** unicodeobject.h	2000/06/18 22:22:27	2.10
--- unicodeobject.h	2000/07/03 10:52:13	2.11
***************
*** 161,164 ****
--- 161,175 ----
  #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)))