summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-04-10 13:41:41 (GMT)
committerGuido van Rossum <guido@python.org>2000-04-10 13:41:41 (GMT)
commit52c2359a590c7d96fc6b077a29df0f0840cdf90b (patch)
tree11dd2878bd7435b478426fb7aee17c119550b385
parent4b49101f20461eb90aaa5cbec4992c989d5a36c8 (diff)
downloadcpython-52c2359a590c7d96fc6b077a29df0f0840cdf90b.zip
cpython-52c2359a590c7d96fc6b077a29df0f0840cdf90b.tar.gz
cpython-52c2359a590c7d96fc6b077a29df0f0840cdf90b.tar.bz2
Marc-Andre Lemburg: New exported API PyUnicode_Resize().
-rw-r--r--Include/unicodeobject.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index e1f5914..6d0435a 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -237,6 +237,25 @@ extern DL_IMPORT(int) PyUnicode_GetSize(
PyObject *unicode /* Unicode object */
);
+/* Resize an already allocated Unicode object to the new size length.
+
+ *unicode is modified to point to the new (resized) object and 0
+ returned on success.
+
+ This API may only be called by the function which also called the
+ Unicode constructor. The refcount on the object must be 1. Otherwise,
+ an error is returned.
+
+ Error handling is implemented as follows: an exception is set, -1
+ is returned and *unicode left untouched.
+
+*/
+
+extern DL_IMPORT(int) PyUnicode_Resize(
+ PyObject **unicode, /* Pointer to the Unicode object */
+ int length /* New length */
+ );
+
/* Coerce obj to an Unicode object and return a reference with
*incremented* refcount.