numpy 2.0.0
|
#include <Python.h>
#include <locale.h>
#include <stdio.h>
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
Defines | |
#define | PY_SSIZE_T_CLEAN |
#define | _MULTIARRAYMODULE |
#define | NPY_NO_PREFIX |
Functions | |
NPY_NO_EXPORT int | PyUCS2Buffer_FromUCS4 (Py_UNICODE *ucs2, PyArray_UCS4 *ucs4, int ucs4length) |
NPY_NO_EXPORT int | PyUCS2Buffer_AsUCS4 (Py_UNICODE *ucs2, PyArray_UCS4 *ucs4, int ucs2len, int ucs4len) |
NPY_NO_EXPORT PyObject * | MyPyUnicode_New (int length) |
NPY_NO_EXPORT int | MyPyUnicode_Resize (PyUnicodeObject *uni, int length) |
#define _MULTIARRAYMODULE |
#define NPY_NO_PREFIX |
#define PY_SSIZE_T_CLEAN |
NPY_NO_EXPORT PyObject* MyPyUnicode_New | ( | int | length | ) |
NPY_NO_EXPORT int MyPyUnicode_Resize | ( | PyUnicodeObject * | uni, |
int | length | ||
) |
NPY_NO_EXPORT int PyUCS2Buffer_AsUCS4 | ( | Py_UNICODE * | ucs2, |
PyArray_UCS4 * | ucs4, | ||
int | ucs2len, | ||
int | ucs4len | ||
) |
It converts up to ucs4len characters of UCS2
It returns the number of characters converted which can be less than ucs2len if there are surrogate pairs in ucs2.
The return value is the actual size of the used part of the ucs4 buffer.
<
NPY_NO_EXPORT int PyUCS2Buffer_FromUCS4 | ( | Py_UNICODE * | ucs2, |
PyArray_UCS4 * | ucs4, | ||
int | ucs4length | ||
) |
due to the use of surrogate pairs.
The return value is the number of ucs2 bytes used-up which is ucs4length + number of surrogate pairs found.
values above 0xffff are converted to surrogate pairs.