]> granicus.if.org Git - python/commitdiff
Marc-Andre Lemburg: New exported API PyUnicode_Resize().
authorGuido van Rossum <guido@python.org>
Mon, 10 Apr 2000 13:41:41 +0000 (13:41 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 10 Apr 2000 13:41:41 +0000 (13:41 +0000)
Include/unicodeobject.h

index e1f5914a8dc70ec8bb523bf205c7656aebf7c13e..6d0435a08ece71a6a0b6147490f56b9c104b150c 100644 (file)
@@ -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.