1 /** 2 Mirror _odictobject.h 3 */ 4 module deimos.python.odictobject; 5 6 import deimos.python.pyport; 7 import deimos.python.object; 8 import deimos.python.dictobject; 9 10 11 version(Python_3_5_Or_Later) { 12 mixin(PyAPI_DATA!"PyTypeObject PyODict_Type"); 13 mixin(PyAPI_DATA!"PyTypeObject PyODictIter_Type"); 14 mixin(PyAPI_DATA!"PyTypeObject PyODictKeys_Type"); 15 mixin(PyAPI_DATA!"PyTypeObject PyODictItems_Type"); 16 mixin(PyAPI_DATA!"PyTypeObject PyODictValues_Type"); 17 18 // D translation of C macro: 19 /// _ 20 int PyODict_Check()(PyObject* op) { 21 return PyObject_TypeCheck(op, &PyODict_Type); 22 } 23 24 // D translation of C macro: 25 /// _ 26 int PyODict_CheckExact()(PyObject* op) { 27 return Py_TYPE(op) == &PyODict_Type; 28 } 29 30 // D translation of C macro: 31 /// _ 32 int PyODict_SIZE()(PyObject* op) { 33 return (cast(PyDictObject*)op).ma_used; 34 } 35 36 // D translation of C macro: 37 /// _ 38 bool PyODict_HasKey()(PyObject* od, char* key) { 39 return PyMapping_HasKey(od, key); 40 } 41 42 /// _ 43 PyObject* PyODict_New(); 44 45 /// _ 46 int PyODict_SetItem(PyObject* od, PyObject* key, PyObject* item); 47 48 /// _ 49 int PyODict_DelItem(PyObject* od, PyObject* key); 50 51 /// _ 52 Borrowed!PyObject* PyODict_GetItem()(PyObject* od, PyObject* key) { 53 return PyDict_GetItem(od, key); 54 } 55 56 /// _ 57 Borrowed!PyObject* PyDict_GetItemWithError()(PyObject* od, PyObject* key) { 58 return PyDict_GetItemWithError(od, key); 59 } 60 61 /// _ 62 int PyODict_Contains()(PyObject* od, PyObject* key) { 63 return PyDict_Contains(od, key); 64 } 65 66 /// _ 67 Py_ssize_t PyODict_Size()(PyObject* od) { 68 return PyDict_Size(od); 69 } 70 71 /// _ 72 Borrowed!PyObject* PyODict_GetItemString()(PyObject* od, const(char)* key) { 73 return PyDict_GetItemString(od, key); 74 } 75 }