Spaces:
Build error
Build error
/* Memory view object. In Python this is available as "memoryview". */ | |
extern "C" { | |
PyAPI_DATA(PyTypeObject) _PyManagedBuffer_Type; | |
PyAPI_DATA(PyTypeObject) PyMemoryView_Type; | |
/* Get a pointer to the memoryview's private copy of the exporter's buffer. */ | |
/* Get a pointer to the exporting object (this may be NULL!). */ | |
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base); | |
PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(char *mem, Py_ssize_t size, | |
int flags); | |
PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(const Py_buffer *info); | |
PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, | |
int buffertype, | |
char order); | |
/* The structs are declared here so that macros can work, but they shouldn't | |
be considered public. Don't access their fields directly, use the macros | |
and functions instead! */ | |
typedef struct { | |
PyObject_HEAD | |
int flags; /* state flags */ | |
Py_ssize_t exports; /* number of direct memoryview exports */ | |
Py_buffer master; /* snapshot buffer obtained from the original exporter */ | |
} _PyManagedBufferObject; | |
/* memoryview state flags */ | |
typedef struct { | |
PyObject_VAR_HEAD | |
_PyManagedBufferObject *mbuf; /* managed buffer */ | |
Py_hash_t hash; /* hash value for read-only views */ | |
int flags; /* state flags */ | |
Py_ssize_t exports; /* number of buffer re-exports */ | |
Py_buffer view; /* private copy of the exporter's view */ | |
PyObject *weakreflist; | |
Py_ssize_t ob_array[1]; /* shape, strides, suboffsets */ | |
} PyMemoryViewObject; | |
} | |