11#ifndef PythonMonkey_BufferType_
12#define PythonMonkey_BufferType_
15#include <js/ScalarType.h>
29 static PyObject *
getPyObject(JSContext *cx, JS::HandleObject bufObj);
38 static JSObject *
toJsTypedArray(JSContext *cx, PyObject *pyObject);
46 static PyObject *
fromJsTypedArray(JSContext *cx, JS::HandleObject typedArray);
50 static void _releasePyBuffer(Py_buffer *bufView);
51 static void _releasePyBuffer(
void *,
void *bufView);
53 static JS::Scalar::Type _getPyBufferType(Py_buffer *bufView);
54 static const char *_toPyBufferFormatCode(JS::Scalar::Type subtype);
61 static JSObject *_newTypedArrayWithBuffer(JSContext *cx, JS::Scalar::Type subtype, JS::HandleObject arrayBuffer);
Definition BufferType.hh:19
static bool isSupportedJsTypes(JSObject *obj)
Definition BufferType.cc:59
static PyObject * fromJsArrayBuffer(JSContext *cx, JS::HandleObject arrayBuffer)
Definition BufferType.cc:111
static JSObject * toJsTypedArray(JSContext *cx, PyObject *pyObject)
Convert a Python object that provides the buffer interface to JS TypedArray. The subtype (Uint8Array,...
Definition BufferType.cc:137
static PyObject * getPyObject(JSContext *cx, JS::HandleObject bufObj)
Construct a new BufferType object from a JS TypedArray or ArrayBuffer, as a Python memoryview object.
Definition BufferType.cc:63
static PyObject * fromJsTypedArray(JSContext *cx, JS::HandleObject typedArray)
Definition BufferType.cc:79