From b8c864037158d4fafe48f6fcb81d9765a88aef2f Mon Sep 17 00:00:00 2001
From: "alexey.stratulat" <alexey.stratulat@demlabs.net>
Date: Sun, 3 Nov 2019 21:43:17 +0700
Subject: [PATCH] [*] Fix. Added description some objects. And fixed wrapping
 object dap_chain_cell_id and dap_chain_node_addr.

---
 include/wrapping_dap_chain_common_objects.h | 143 +++++++++++++++++++-
 1 file changed, 140 insertions(+), 3 deletions(-)

diff --git a/include/wrapping_dap_chain_common_objects.h b/include/wrapping_dap_chain_common_objects.h
index 7bd08b54..b69df9a6 100644
--- a/include/wrapping_dap_chain_common_objects.h
+++ b/include/wrapping_dap_chain_common_objects.h
@@ -8,21 +8,158 @@
 extern "C" {
 #endif
 
+/* DAP Chain ID*/
 typedef struct PyDapChainId{
     PyObject_HEAD
-    dap_chain_id_t *id;
+    dap_chain_id_t id;
 }PyDapChainIdObject;
 
+static PyTypeObject DapChainIdObject_DapChainIdObjectType = {
+    PyVarObject_HEAD_INIT(NULL, 0)
+    "CellFrame.ChainID",             /* tp_name */
+    sizeof(PyDapChainIdObject),      /* tp_basicsize */
+    0,                               /* tp_itemsize */
+    0,                               /* tp_dealloc */
+    0,                               /* tp_print */
+    0,                               /* tp_getattr */
+    0,                               /* tp_setattr */
+    0,                               /* tp_reserved */
+    0,                               /* tp_repr */
+    0,                               /* tp_as_number */
+    0,                               /* tp_as_sequence */
+    0,                               /* tp_as_mapping */
+    0,                               /* tp_hash  */
+    0,                               /* tp_call */
+    0,                               /* tp_str */
+    0,                               /* tp_getattro */
+    0,                               /* tp_setattro */
+    0,                               /* tp_as_buffer */
+    Py_TPFLAGS_DEFAULT |
+        Py_TPFLAGS_BASETYPE,         /* tp_flags */
+    "Chain id object",           /* tp_doc */
+    0,		                         /* tp_traverse */
+    0,		                         /* tp_clear */
+    0,		                         /* tp_richcompare */
+    0,                               /* tp_weaklistoffset */
+    0,		                         /* tp_iter */
+    0,		                         /* tp_iternext */
+    0,                               /* tp_methods */
+    0,                               /* tp_members */
+    0,                               /* tp_getset */
+    0,                               /* tp_base */
+    0,                               /* tp_dict */
+    0,                               /* tp_descr_get */
+    0,                               /* tp_descr_set */
+    0,                               /* tp_dictoffset */
+    0,                               /* tp_init */
+    0,                               /* tp_alloc */
+    PyType_GenericNew,               /* tp_new */
+};
+
+/*-------------------------------*/
+
+/* DAP chain cell id */
+
 typedef struct PyDapChainCellId{
     PyObject_HEAD
     dap_chain_cell_id_t *id;
-}PyDapChainCellId;
+}PyDapChainCellIdObject;
+
+static PyTypeObject DapChainCellIdObject_DapChainCellIdObjectType = {
+    PyVarObject_HEAD_INIT(NULL, 0)
+    "CellFrame.ChainCellID",             /* tp_name */
+    sizeof(PyDapChainCellIdObject),      /* tp_basicsize */
+    0,                               /* tp_itemsize */
+    0,                               /* tp_dealloc */
+    0,                               /* tp_print */
+    0,                               /* tp_getattr */
+    0,                               /* tp_setattr */
+    0,                               /* tp_reserved */
+    0,                               /* tp_repr */
+    0,                               /* tp_as_number */
+    0,                               /* tp_as_sequence */
+    0,                               /* tp_as_mapping */
+    0,                               /* tp_hash  */
+    0,                               /* tp_call */
+    0,                               /* tp_str */
+    0,                               /* tp_getattro */
+    0,                               /* tp_setattro */
+    0,                               /* tp_as_buffer */
+    Py_TPFLAGS_DEFAULT |
+        Py_TPFLAGS_BASETYPE,         /* tp_flags */
+    "Chain cell id object",           /* tp_doc */
+    0,		                         /* tp_traverse */
+    0,		                         /* tp_clear */
+    0,		                         /* tp_richcompare */
+    0,                               /* tp_weaklistoffset */
+    0,		                         /* tp_iter */
+    0,		                         /* tp_iternext */
+    0,                               /* tp_methods */
+    0,                               /* tp_members */
+    0,                               /* tp_getset */
+    0,                               /* tp_base */
+    0,                               /* tp_dict */
+    0,                               /* tp_descr_get */
+    0,                               /* tp_descr_set */
+    0,                               /* tp_dictoffset */
+    0,                               /* tp_init */
+    0,                               /* tp_alloc */
+    PyType_GenericNew,               /* tp_new */
+};
+
+/*-------------------------------*/
+
+/* DAP chain Addr */
 
 typedef struct PyDapChainNodeAddr{
     PyObject_HEAD
     dap_chain_node_addr_t *node_addr;
 }PyDapChainNodeAddrObject;
 
+static PyTypeObject DapChainNodeAddrObject_DapChainNodeAddrObjectType = {
+    PyVarObject_HEAD_INIT(NULL, 0)
+    "CellFrame.ChainCellID",             /* tp_name */
+    sizeof(PyDapChainNodeAddrObject),      /* tp_basicsize */
+    0,                               /* tp_itemsize */
+    0,                               /* tp_dealloc */
+    0,                               /* tp_print */
+    0,                               /* tp_getattr */
+    0,                               /* tp_setattr */
+    0,                               /* tp_reserved */
+    0,                               /* tp_repr */
+    0,                               /* tp_as_number */
+    0,                               /* tp_as_sequence */
+    0,                               /* tp_as_mapping */
+    0,                               /* tp_hash  */
+    0,                               /* tp_call */
+    0,                               /* tp_str */
+    0,                               /* tp_getattro */
+    0,                               /* tp_setattro */
+    0,                               /* tp_as_buffer */
+    Py_TPFLAGS_DEFAULT |
+        Py_TPFLAGS_BASETYPE,         /* tp_flags */
+    "Chain node addr object",           /* tp_doc */
+    0,		                         /* tp_traverse */
+    0,		                         /* tp_clear */
+    0,		                         /* tp_richcompare */
+    0,                               /* tp_weaklistoffset */
+    0,		                         /* tp_iter */
+    0,		                         /* tp_iternext */
+    0,                               /* tp_methods */
+    0,                               /* tp_members */
+    0,                               /* tp_getset */
+    0,                               /* tp_base */
+    0,                               /* tp_dict */
+    0,                               /* tp_descr_get */
+    0,                               /* tp_descr_set */
+    0,                               /* tp_dictoffset */
+    0,                               /* tp_init */
+    0,                               /* tp_alloc */
+    PyType_GenericNew,               /* tp_new */
+};
+
+/*-------------------------------*/
+
 typedef struct PyDapChainNodeRole{
     PyObject_HEAD
     dap_chain_node_role_t *node_role;
@@ -32,7 +169,7 @@ typedef struct PyDapChainNodeRole{
 
 typedef struct PyDapChainNetId{
     PyObject_HEAD
-    dap_chain_net_id_t *net_id;
+    dap_chain_net_id_t net_id;
 }PyDapChainNetIdObject; 
 
 static PyTypeObject DapChainNetIdObject_DapChainNetIdObjectType = {
-- 
GitLab