[Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.45,2.45.2.1 unicodeobject.h,2.20.2.1,2.20.2.2
Tim Peters
tim_one@users.sourceforge.net
Wed, 01 Aug 2001 19:40:44 -0700
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv23606/descr/dist/src/Include
Modified Files:
Tag: descr-branch
pyerrors.h unicodeobject.h
Log Message:
Mrege of trunk tag delta date2001-07-30 to date2001-08-01.
Index: pyerrors.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v
retrieving revision 2.45
retrieving revision 2.45.2.1
diff -C2 -d -r2.45 -r2.45.2.1
*** pyerrors.h 2001/04/20 19:13:01 2.45
--- pyerrors.h 2001/08/02 02:40:42 2.45.2.1
***************
*** 107,110 ****
--- 107,134 ----
extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int);
+ /* These APIs aren't really part of the error implementation, but
+ often needed to format error messages; the native C lib APIs are
+ not available on all platforms, which is why we provide emulations
+ for those platforms in Python/mysnprintf.c */
+ #if defined(MS_WIN32) && !defined(HAVE_SNPRINTF)
+ # define HAVE_SNPRINTF
+ # define snprintf _snprintf
+ # define vsnprintf _vsnprintf
+ #endif
+
+ /* Always enable the fallback solution during the 2.2.0 alpha cycle
+ for enhanced testing */
+ #if PY_VERSION_HEX < 0x020200B0
+ # undef HAVE_SNPRINTF
+ #endif
+
+ #ifndef HAVE_SNPRINTF
+ #include <stdarg.h>
+ extern DL_IMPORT(int) PyOS_snprintf(char *str, size_t size, const char *format, ...);
+ extern DL_IMPORT(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va);
+ #else
+ # define PyOS_vsnprintf vsnprintf
+ # define PyOS_snprintf snprintf
+ #endif
#ifdef __cplusplus
Index: unicodeobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/unicodeobject.h,v
retrieving revision 2.20.2.1
retrieving revision 2.20.2.2
diff -C2 -d -r2.20.2.1 -r2.20.2.2
*** unicodeobject.h 2001/07/07 22:55:27 2.20.2.1
--- unicodeobject.h 2001/08/02 02:40:42 2.20.2.2
***************
*** 130,133 ****
--- 130,283 ----
typedef PY_UNICODE_TYPE Py_UNICODE;
+ /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */
+
+ /* Unicode API names are mangled to assure that UCS-2 and UCS-4 builds
+ produce different external names and thus cause import errors in
+ case Python interpreters and extensions with mixed compiled in
+ Unicode width assumptions are combined. */
+
+ #ifndef Py_UNICODE_WIDE
+
+ # define PyUnicode_AsASCIIString PyUnicodeUCS2_AsASCIIString
+ # define PyUnicode_AsCharmapString PyUnicodeUCS2_AsCharmapString
+ # define PyUnicode_AsEncodedString PyUnicodeUCS2_AsEncodedString
+ # define PyUnicode_AsLatin1String PyUnicodeUCS2_AsLatin1String
+ # define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS2_AsRawUnicodeEscapeString
+ # define PyUnicode_AsUTF16String PyUnicodeUCS2_AsUTF16String
+ # define PyUnicode_AsUTF8String PyUnicodeUCS2_AsUTF8String
+ # define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode
+ # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString
+ # define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar
+ # define PyUnicode_Compare PyUnicodeUCS2_Compare
+ # define PyUnicode_Concat PyUnicodeUCS2_Concat
+ # define PyUnicode_Contains PyUnicodeUCS2_Contains
+ # define PyUnicode_Count PyUnicodeUCS2_Count
+ # define PyUnicode_Decode PyUnicodeUCS2_Decode
+ # define PyUnicode_DecodeASCII PyUnicodeUCS2_DecodeASCII
+ # define PyUnicode_DecodeCharmap PyUnicodeUCS2_DecodeCharmap
+ # define PyUnicode_DecodeLatin1 PyUnicodeUCS2_DecodeLatin1
+ # define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS2_DecodeRawUnicodeEscape
+ # define PyUnicode_DecodeUTF16 PyUnicodeUCS2_DecodeUTF16
+ # define PyUnicode_DecodeUTF8 PyUnicodeUCS2_DecodeUTF8
+ # define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS2_DecodeUnicodeEscape
+ # define PyUnicode_Encode PyUnicodeUCS2_Encode
+ # define PyUnicode_EncodeASCII PyUnicodeUCS2_EncodeASCII
+ # define PyUnicode_EncodeCharmap PyUnicodeUCS2_EncodeCharmap
+ # define PyUnicode_EncodeDecimal PyUnicodeUCS2_EncodeDecimal
+ # define PyUnicode_EncodeLatin1 PyUnicodeUCS2_EncodeLatin1
+ # define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS2_EncodeRawUnicodeEscape
+ # define PyUnicode_EncodeUTF16 PyUnicodeUCS2_EncodeUTF16
+ # define PyUnicode_EncodeUTF8 PyUnicodeUCS2_EncodeUTF8
+ # define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS2_EncodeUnicodeEscape
+ # define PyUnicode_Find PyUnicodeUCS2_Find
+ # define PyUnicode_Format PyUnicodeUCS2_Format
+ # define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject
+ # define PyUnicode_FromObject PyUnicodeUCS2_FromObject
+ # define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode
+ # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar
+ # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding
+ # define PyUnicode_GetMax PyUnicodeUCS2_GetMax
+ # define PyUnicode_GetSize PyUnicodeUCS2_GetSize
+ # define PyUnicode_Join PyUnicodeUCS2_Join
+ # define PyUnicode_Replace PyUnicodeUCS2_Replace
+ # define PyUnicode_Resize PyUnicodeUCS2_Resize
+ # define PyUnicode_SetDefaultEncoding PyUnicodeUCS2_SetDefaultEncoding
+ # define PyUnicode_Split PyUnicodeUCS2_Split
+ # define PyUnicode_Splitlines PyUnicodeUCS2_Splitlines
+ # define PyUnicode_Tailmatch PyUnicodeUCS2_Tailmatch
+ # define PyUnicode_Translate PyUnicodeUCS2_Translate
+ # define PyUnicode_TranslateCharmap PyUnicodeUCS2_TranslateCharmap
+ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString
+ # define _PyUnicode_Fini _PyUnicodeUCS2_Fini
+ # define _PyUnicode_Init _PyUnicodeUCS2_Init
+ # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha
+ # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit
+ # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit
+ # define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak
+ # define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase
+ # define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric
+ # define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase
+ # define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase
+ # define _PyUnicode_IsWhitespace _PyUnicodeUCS2_IsWhitespace
+ # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS2_ToDecimalDigit
+ # define _PyUnicode_ToDigit _PyUnicodeUCS2_ToDigit
+ # define _PyUnicode_ToLowercase _PyUnicodeUCS2_ToLowercase
+ # define _PyUnicode_ToNumeric _PyUnicodeUCS2_ToNumeric
+ # define _PyUnicode_ToTitlecase _PyUnicodeUCS2_ToTitlecase
+ # define _PyUnicode_ToUppercase _PyUnicodeUCS2_ToUppercase
+
+ #else
+
+ # define PyUnicode_AsASCIIString PyUnicodeUCS4_AsASCIIString
+ # define PyUnicode_AsCharmapString PyUnicodeUCS4_AsCharmapString
+ # define PyUnicode_AsEncodedString PyUnicodeUCS4_AsEncodedString
+ # define PyUnicode_AsLatin1String PyUnicodeUCS4_AsLatin1String
+ # define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS4_AsRawUnicodeEscapeString
+ # define PyUnicode_AsUTF16String PyUnicodeUCS4_AsUTF16String
+ # define PyUnicode_AsUTF8String PyUnicodeUCS4_AsUTF8String
+ # define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode
+ # define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString
+ # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
+ # define PyUnicode_Compare PyUnicodeUCS4_Compare
+ # define PyUnicode_Concat PyUnicodeUCS4_Concat
+ # define PyUnicode_Contains PyUnicodeUCS4_Contains
+ # define PyUnicode_Count PyUnicodeUCS4_Count
+ # define PyUnicode_Decode PyUnicodeUCS4_Decode
+ # define PyUnicode_DecodeASCII PyUnicodeUCS4_DecodeASCII
+ # define PyUnicode_DecodeCharmap PyUnicodeUCS4_DecodeCharmap
+ # define PyUnicode_DecodeLatin1 PyUnicodeUCS4_DecodeLatin1
+ # define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS4_DecodeRawUnicodeEscape
+ # define PyUnicode_DecodeUTF16 PyUnicodeUCS4_DecodeUTF16
+ # define PyUnicode_DecodeUTF8 PyUnicodeUCS4_DecodeUTF8
+ # define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS4_DecodeUnicodeEscape
+ # define PyUnicode_Encode PyUnicodeUCS4_Encode
+ # define PyUnicode_EncodeASCII PyUnicodeUCS4_EncodeASCII
+ # define PyUnicode_EncodeCharmap PyUnicodeUCS4_EncodeCharmap
+ # define PyUnicode_EncodeDecimal PyUnicodeUCS4_EncodeDecimal
+ # define PyUnicode_EncodeLatin1 PyUnicodeUCS4_EncodeLatin1
+ # define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS4_EncodeRawUnicodeEscape
+ # define PyUnicode_EncodeUTF16 PyUnicodeUCS4_EncodeUTF16
+ # define PyUnicode_EncodeUTF8 PyUnicodeUCS4_EncodeUTF8
+ # define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS4_EncodeUnicodeEscape
+ # define PyUnicode_Find PyUnicodeUCS4_Find
+ # define PyUnicode_Format PyUnicodeUCS4_Format
+ # define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject
+ # define PyUnicode_FromObject PyUnicodeUCS4_FromObject
+ # define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode
+ # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar
+ # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding
+ # define PyUnicode_GetMax PyUnicodeUCS4_GetMax
+ # define PyUnicode_GetSize PyUnicodeUCS4_GetSize
+ # define PyUnicode_Join PyUnicodeUCS4_Join
+ # define PyUnicode_Replace PyUnicodeUCS4_Replace
+ # define PyUnicode_Resize PyUnicodeUCS4_Resize
+ # define PyUnicode_SetDefaultEncoding PyUnicodeUCS4_SetDefaultEncoding
+ # define PyUnicode_Split PyUnicodeUCS4_Split
+ # define PyUnicode_Splitlines PyUnicodeUCS4_Splitlines
+ # define PyUnicode_Tailmatch PyUnicodeUCS4_Tailmatch
+ # define PyUnicode_Translate PyUnicodeUCS4_Translate
+ # define PyUnicode_TranslateCharmap PyUnicodeUCS4_TranslateCharmap
+ # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString
+ # define _PyUnicode_Fini _PyUnicodeUCS4_Fini
+ # define _PyUnicode_Init _PyUnicodeUCS4_Init
+ # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha
+ # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit
+ # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit
+ # define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak
+ # define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase
+ # define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric
+ # define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase
+ # define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase
+ # define _PyUnicode_IsWhitespace _PyUnicodeUCS4_IsWhitespace
+ # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS4_ToDecimalDigit
+ # define _PyUnicode_ToDigit _PyUnicodeUCS4_ToDigit
+ # define _PyUnicode_ToLowercase _PyUnicodeUCS4_ToLowercase
+ # define _PyUnicode_ToNumeric _PyUnicodeUCS4_ToNumeric
+ # define _PyUnicode_ToTitlecase _PyUnicodeUCS4_ToTitlecase
+ # define _PyUnicode_ToUppercase _PyUnicodeUCS4_ToUppercase
+
+
+ #endif
+
/* --- Internal Unicode Operations ---------------------------------------- */
***************
*** 386,389 ****
--- 536,556 ----
/* --- Manage the default encoding ---------------------------------------- */
+
+ /* Return a Python string holding the default encoded value of the
+ Unicode object.
+
+ The resulting string is cached in the Unicode object for subsequent
+ usage by this function. The cached version is needed to implement
+ the character buffer interface and will live (at least) as long as
+ the Unicode object itself.
+
+ The refcount of the string is *not* incremented.
+
+ *** Exported for internal use by the interpreter only !!! ***
+
+ */
+
+ extern DL_IMPORT(PyObject *) _PyUnicode_AsDefaultEncodedString(
+ PyObject *, const char *);
/* Returns the currently active default encoding.