summaryrefslogtreecommitdiffstats
path: root/pywrap
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-02-16 16:30:40 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-02-16 16:30:40 +0100
commited9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590 (patch)
tree8b05ef6a4585b0d585f82c468cf92048a05f79ee /pywrap
parentfc80d8b64672785b4d9c7127e852ca9bf19c9194 (diff)
downloadpcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.tar.gz
pcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.tar.bz2
pcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.tar.xz
pcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.zip
1. Add python thread initialization to pcilib_init_py()
-Fix pcilib_script_run_func() work in multithread mode 2. pcilib_close() - Move free_py() code after free views to make view destructors work properly 3. Move script hash to pcilib_py_s 4. Move pcilib_get_logger() pcilib_get_logger_min_prio() and pcilib_get_logger_argument() declarations to error.h 5. Refactor pcilib_get_value_as_pyobject pcilib_set_value_from_pyobject to more unified form 6. Add more memory checks. Fix some string memory allocations. 7. Refactor pcilib_py_s member names. 8. Merge pcilib_script_read() and pcilib_script_write() to pcilib_script_run_func() 9. Update test_pywrap views scripts
Diffstat (limited to 'pywrap')
-rw-r--r--pywrap/pcipywrap.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/pywrap/pcipywrap.c b/pywrap/pcipywrap.c
index b1ee630..40dbdfc 100644
--- a/pywrap/pcipywrap.c
+++ b/pywrap/pcipywrap.c
@@ -127,7 +127,6 @@ PyObject* create_pcilib_instance(const char *fpga_device, const char *model)
pcilib_error("#E Failed pcilib_open(%s, %s)", fpga_device, model);
return NULL;
}
-
return PyCObject_FromVoidPtr((void*)ctx, close_pcilib_instance);
}
@@ -204,7 +203,7 @@ PyObject* read_register(const char *regname, const char *bank)
return NULL;
}
- return pcilib_get_value_as_pyobject(__ctx, &val);
+ return pcilib_get_value_as_pyobject(__ctx, &val, NULL);
}
/*!
@@ -228,7 +227,7 @@ PyObject* write_register(PyObject* val, const char *regname, const char *bank)
int err;
- err = pcilib_set_value_from_pyobject(__ctx, val, &val_internal);
+ err = pcilib_set_value_from_pyobject(__ctx, &val_internal, val);
if(err)
{
@@ -279,7 +278,7 @@ PyObject* get_property(const char *prop)
return NULL;
}
- return pcilib_get_value_as_pyobject(__ctx, &val);
+ return pcilib_get_value_as_pyobject(__ctx, &val, NULL);
}
/*!
@@ -299,7 +298,7 @@ PyObject* set_property(PyObject* val, const char *prop)
}
pcilib_value_t val_internal = {0};
- err = pcilib_set_value_from_pyobject(__ctx, val, &val_internal);
+ err = pcilib_set_value_from_pyobject(__ctx, &val_internal, val);
if(err)
{
pcilib_error("#E pcilib_set_value_from_pyobject, (error %i)", err);
@@ -339,7 +338,7 @@ void pcilib_pylist_append(PyObject* list, PyObject* value)
void add_pcilib_value_to_dict(PyObject* dict, pcilib_value_t* val, const char *name)
{
- PyObject *py_val = (PyObject*)pcilib_get_value_as_pyobject(__ctx, val);
+ PyObject *py_val = (PyObject*)pcilib_get_value_as_pyobject(__ctx, val, NULL);
if(py_val)
pcilib_pydict_set_item(dict,