required by the application.
-.. c:function:: wchar_t* PyUnicode_AsWideCharString(PyUnicodeObject *unicode, Py_ssize_t *size)
+.. c:function:: wchar_t* PyUnicode_AsWideCharString(PyObject *unicode, Py_ssize_t *size)
Convert the Unicode object to a wide character string. The output string
always ends with a nul character. If *size* is not *NULL*, write the number
MemoryError. */
PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
- PyUnicodeObject *unicode, /* Unicode object */
+ PyObject *unicode, /* Unicode object */
Py_ssize_t *size /* number of characters of the result */
);
return 0;
#else
pa->ffi_type = &ffi_type_pointer;
- pa->value.p = PyUnicode_AsWideCharString((PyUnicodeObject *)obj, NULL);
+ pa->value.p = PyUnicode_AsWideCharString(obj, NULL);
if (pa->value.p == NULL)
return -1;
pa->keep = PyCapsule_New(pa->value.p, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
PyObject *keep;
wchar_t *buffer;
- buffer = PyUnicode_AsWideCharString((PyUnicodeObject *)value, NULL);
+ buffer = PyUnicode_AsWideCharString(value, NULL);
if (!buffer) {
Py_DECREF(value);
return NULL;
if (!PyArg_ParseTuple(args, "UU:strcoll", &os1, &os2))
return NULL;
/* Convert the unicode strings to wchar[]. */
- ws1 = PyUnicode_AsWideCharString((PyUnicodeObject*)os1, NULL);
+ ws1 = PyUnicode_AsWideCharString(os1, NULL);
if (ws1 == NULL)
goto done;
- ws2 = PyUnicode_AsWideCharString((PyUnicodeObject*)os2, NULL);
+ ws2 = PyUnicode_AsWideCharString(os2, NULL);
if (ws2 == NULL)
goto done;
/* Collate the strings. */
if (!PyArg_ParseTuple(args, "U", &unicode))
return NULL;
- buffer = PyUnicode_AsWideCharString((PyUnicodeObject*)unicode, &size);
+ buffer = PyUnicode_AsWideCharString(unicode, &size);
if (buffer == NULL)
return NULL;
buf.tm_isdst = 1;
#ifdef HAVE_WCSFTIME
- format = PyUnicode_AsWideCharString((PyUnicodeObject*)format_arg, NULL);
+ format = PyUnicode_AsWideCharString(format_arg, NULL);
if (format == NULL)
return NULL;
fmt = format;
}
wchar_t*
-PyUnicode_AsWideCharString(PyUnicodeObject *unicode,
+PyUnicode_AsWideCharString(PyObject *unicode,
Py_ssize_t *size)
{
wchar_t* buffer;
return NULL;
}
- buflen = unicode_aswidechar(unicode, NULL, 0);
+ buflen = unicode_aswidechar((PyUnicodeObject *)unicode, NULL, 0);
if (PY_SSIZE_T_MAX / sizeof(wchar_t) < buflen) {
PyErr_NoMemory();
return NULL;
PyErr_NoMemory();
return NULL;
}
- buflen = unicode_aswidechar(unicode, buffer, buflen);
+ buflen = unicode_aswidechar((PyUnicodeObject *)unicode, buffer, buflen);
if (size != NULL)
*size = buflen;
return buffer;
if (usize == 0)
return NULL;
- path = PyUnicode_AsWideCharString((PyUnicodeObject*)unicode, NULL);
+ path = PyUnicode_AsWideCharString(unicode, NULL);
if (path == NULL)
return NULL;
f = _wfopen(path, wmode);
int err;
struct _stat wstatbuf;
- path = PyUnicode_AsWideCharString((PyUnicodeObject*)unicode, NULL);
+ path = PyUnicode_AsWideCharString(unicode, NULL);
if (path == NULL)
return -1;
err = _wstat(path, &wstatbuf);
return -1;
}
- path = PyUnicode_AsWideCharString((PyUnicodeObject*)pathobj, NULL);
+ path = PyUnicode_AsWideCharString(pathobj, NULL);
if (path == NULL)
return -1;
/* see issue1293 and issue3677: