From 8cf9c714a47d7620aa95fdc19ef94154aec89e95 Mon Sep 17 00:00:00 2001
From: "alexey.stratulat" <alexey.stratulat@demlabs.net>
Date: Mon, 11 Nov 2019 22:00:56 +0700
Subject: [PATCH] [+] Added wrapping for function dap_chain_cell_load.

---
 include/wrapping_dap_chain_cell.h | 1 +
 src/wrapping_dap_chain_cell.c     | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/wrapping_dap_chain_cell.h b/include/wrapping_dap_chain_cell.h
index 27213869..8584e31b 100644
--- a/include/wrapping_dap_chain_cell.h
+++ b/include/wrapping_dap_chain_cell.h
@@ -2,6 +2,7 @@
 #define _WRAPPING_DAP_CHAIN_CELL_
 #include "Python.h"
 #include "dap_chain_cell.h"
+#include "libdap-chain-python.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/wrapping_dap_chain_cell.c b/src/wrapping_dap_chain_cell.c
index 63fe521a..6d1369b4 100644
--- a/src/wrapping_dap_chain_cell.c
+++ b/src/wrapping_dap_chain_cell.c
@@ -11,8 +11,12 @@ PyObject *DapChainCellObject_create(PyTypeObject *type_object, PyObject *args, P
 }
 
 PyObject *dap_chain_cell_load_py(PyObject *self, PyObject *args){
-    //TODO
-    return NULL;
+    PyObject *obj_chain;
+    const char *cell_file_path;
+    if (!PyArg_ParseTuple(args, "O|s", &obj_chain, &cell_file_path))
+        return NULL;
+    int res = dap_chain_cell_load(((PyDapChainObject*)obj_chain)->chain_t, cell_file_path);
+    return PyLong_FromLong(res);
 }
 PyObject *dap_chain_cell_file_update_py(PyObject *self, PyObject *args){
     int res = dap_chain_cell_file_update(((PyDapChainCellObject*)self)->cell);
-- 
GitLab