Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52c2359

Browse files
committed
Marc-Andre Lemburg: New exported API PyUnicode_Resize().
1 parent 4b49101 commit 52c2359

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Include/unicodeobject.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,25 @@ extern DL_IMPORT(int) PyUnicode_GetSize(
237237
PyObject *unicode /* Unicode object */
238238
);
239239

240+
/* Resize an already allocated Unicode object to the new size length.
241+
242+
*unicode is modified to point to the new (resized) object and 0
243+
returned on success.
244+
245+
This API may only be called by the function which also called the
246+
Unicode constructor. The refcount on the object must be 1. Otherwise,
247+
an error is returned.
248+
249+
Error handling is implemented as follows: an exception is set, -1
250+
is returned and *unicode left untouched.
251+
252+
*/
253+
254+
extern DL_IMPORT(int) PyUnicode_Resize(
255+
PyObject **unicode, /* Pointer to the Unicode object */
256+
int length /* New length */
257+
);
258+
240259
/* Coerce obj to an Unicode object and return a reference with
241260
*incremented* refcount.
242261

0 commit comments

Comments
 (0)