From f526c4a5a3e4f35bb1c4b03af1f3244a8c0db48a Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Thu, 11 Feb 2016 12:00:54 +0100 Subject: Change error logging method in Python wrap. Move functions, that converts values between PyObject and pcilib_value_t to py.c --- pcilib/py.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'pcilib/py.h') diff --git a/pcilib/py.h b/pcilib/py.h index 8fd749c..d0f1328 100644 --- a/pcilib/py.h +++ b/pcilib/py.h @@ -20,6 +20,26 @@ int pcilib_free_py_script(pcilib_script_t *module); int pcilib_script_read(pcilib_t *ctx, pcilib_script_t *module, pcilib_value_t *val); int pcilib_script_write(pcilib_t *ctx, pcilib_script_t *module, pcilib_value_t *val); + +/*! + * \brief Converts pcilib_value_t to PyObject. + * \param ctx pointer to pcilib_t context + * \param val pointer to pcilib_value_t to convert + * \return PyObject, containing value. NULL with error message, sended to errstream. + */ +void* pcilib_convert_val_to_pyobject(pcilib_t* ctx, pcilib_value_t *val); + + +/*! + * \brief Converts PyObject to pcilib_value_t. + * \param ctx pcilib context + * \param pyVal python object, containing value + * \param val initialized polymorphic value + * \return 0 on success or memory error + */ +int pcilib_convert_pyobject_to_val(pcilib_t* ctx, void* pyVal, pcilib_value_t *val); + + #ifdef __cplusplus } #endif -- cgit v1.2.3