[Python-checkins] python/dist/src/Include unicodeobject.h, 2.42, 2.43

perky at users.sourceforge.net perky at users.sourceforge.net
Wed Jun 2 12:49:41 EDT 2004


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32555/Include

Modified Files:
	unicodeobject.h 
Log Message:
- SF #962502: Add two more methods for unicode type; width() and
iswide() for east asian width manipulation. (Inspired by David
Goodger, Reviewed by Martin v. Loewis)
- Move _PyUnicode_TypeRecord.flags to the end of the struct so that
no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)


Index: unicodeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.42
retrieving revision 2.43
diff -C2 -d -r2.42 -r2.43
*** unicodeobject.h	15 Dec 2003 18:49:19 -0000	2.42
--- unicodeobject.h	2 Jun 2004 16:49:08 -0000	2.43
***************
*** 181,184 ****
--- 181,185 ----
  # define PyUnicode_GetMax PyUnicodeUCS2_GetMax
  # define PyUnicode_GetSize PyUnicodeUCS2_GetSize
+ # define PyUnicode_GetWidth PyUnicodeUCS2_GetWidth
  # define PyUnicode_Join PyUnicodeUCS2_Join
  # define PyUnicode_Replace PyUnicodeUCS2_Replace
***************
*** 200,203 ****
--- 201,205 ----
  # define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase
  # define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric
+ # define _PyUnicode_IsWide _PyUnicodeUCS2_IsWide
  # define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase
  # define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase
***************
*** 253,256 ****
--- 255,259 ----
  # define PyUnicode_GetMax PyUnicodeUCS4_GetMax
  # define PyUnicode_GetSize PyUnicodeUCS4_GetSize
+ # define PyUnicode_GetWidth PyUnicodeUCS4_GetWidth
  # define PyUnicode_Join PyUnicodeUCS4_Join
  # define PyUnicode_Replace PyUnicodeUCS4_Replace
***************
*** 271,274 ****
--- 274,278 ----
  # define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase
  # define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric
+ # define _PyUnicode_IsWide _PyUnicodeUCS4_IsWide
  # define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase
  # define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase
***************
*** 316,319 ****
--- 320,325 ----
  #define Py_UNICODE_ISALPHA(ch) iswalpha(ch)
  
+ #define Py_UNICODE_ISWIDE(ch) _PyUnicode_IsWide(ch)
+ 
  #else
  
***************
*** 339,342 ****
--- 345,350 ----
  #define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch)
  
+ #define Py_UNICODE_ISWIDE(ch) _PyUnicode_IsWide(ch)
+ 
  #endif
  
***************
*** 431,434 ****
--- 439,448 ----
      );
  
+ /* Get the fixed-width representation length of the Unicode object */
+ 
+ PyAPI_FUNC(int) PyUnicode_GetWidth(
+     PyObject *unicode	 	/* Unicode object */
+     );
+ 
  /* Get the maximum ordinal for a Unicode character. */
  PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
***************
*** 1152,1155 ****
--- 1166,1173 ----
      );
  
+ PyAPI_FUNC(int) _PyUnicode_IsWide(
+     Py_UNICODE ch 	/* Unicode character */
+     );
+ 
  #ifdef __cplusplus
  }




More information about the Python-checkins mailing list