On 17-Mar-2000, Marc-Andre Lemburg said:
Attached you find an update of the Unicode implementation.
The patch is against the current CVS version. I would appreciate
if someone with CVS checkin permissions could check the changes
in.
The patch contains all bugs and patches sent this week and also
fixes a leak in the codecs code and a bug in the free list code
for Unicode objects (which only shows up when compiling Python
with Py_DEBUG; thanks to MarkH for spotting this one).
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 37f2b0d..770ecab 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -1,8 +1,5 @@
#ifndef Py_UNICODEOBJECT_H
#define Py_UNICODEOBJECT_H
-#ifdef __cplusplus
-extern "C" {
-#endif
/*
@@ -109,8 +106,9 @@
/* --- Internal Unicode Operations ---------------------------------------- */
/* If you want Python to use the compiler's wctype.h functions instead
- of the ones supplied with Python, define WANT_WCTYPE_FUNCTIONS.
- This reduces the interpreter's code size. */
+ of the ones supplied with Python, define WANT_WCTYPE_FUNCTIONS or
+ configure Python using --with-ctype-functions. This reduces the
+ interpreter's code size. */
#if defined(HAVE_USABLE_WCHAR_T) && defined(WANT_WCTYPE_FUNCTIONS)
@@ -169,6 +167,10 @@
(!memcmp((string)->str + (offset), (substring)->str,\
(substring)->length*sizeof(Py_UNICODE)))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* --- Unicode Type ------------------------------------------------------- */
typedef struct {
@@ -647,7 +649,7 @@
int direction /* Find direction: +1 forward, -1 backward */
);
-/* Count the number of occurances of substr in str[start:end]. */
+/* Count the number of occurrences of substr in str[start:end]. */
extern DL_IMPORT(int) PyUnicode_Count(
PyObject *str, /* String */
@@ -656,7 +658,7 @@
int end /* Stop index */
);
-/* Replace at most maxcount occurances of substr in str with replstr
+/* Replace at most maxcount occurrences of substr in str with replstr
and return the resulting Unicode object. */
extern DL_IMPORT(PyObject *) PyUnicode_Replace(