1 /**
2   mirror _bufferobject.h
3 
4   (note bufferobject.h does not exist in python 3)
5   */
6 module deimos.python.bufferobject;
7 
8 import deimos.python.pyport;
9 import deimos.python.object;
10 
11 extern(C):
12 // Python-header-file: Include/bufferobject.h:
13 
14 version(Python_3_0_Or_Later) {
15     // no bufferobject in python 3
16 }else{
17 
18 /// Availability: 2.*
19 mixin(PyAPI_DATA!"PyTypeObject PyBuffer_Type");
20 
21 // D translation of C macro:
22 /// Availability: 2.*
23 int PyBuffer_Check()(PyObject* op) {
24     return op.ob_type == &PyBuffer_Type;
25 }
26 
27 /// Availability: 2.*
28 enum Py_END_OF_BUFFER = -1;
29 
30 /// Availability: 2.*
31 PyObject* PyBuffer_FromObject(
32         PyObject* base,
33         Py_ssize_t offset,
34         Py_ssize_t size);
35 /// Availability: 2.*
36 PyObject* PyBuffer_FromReadWriteObject(
37         PyObject* base,
38         Py_ssize_t offset,
39         Py_ssize_t size);
40 /// Availability: 2.*
41 PyObject* PyBuffer_FromMemory(void* ptr, Py_ssize_t size);
42 /// Availability: 2.*
43 PyObject* PyBuffer_FromReadWriteMemory(void* ptr, Py_ssize_t size);
44 /// Availability: 2.*
45 PyObject* PyBuffer_New(Py_ssize_t size);
46 
47 
48 }