From 5d775d64bdec554b9842823bd1c46263210425fd Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Tue, 1 Mar 2016 10:42:40 +0100 Subject: 1. multithreading: - Enable multiprocessing for api_server - Enable mutrithreading for html_server 2. py: - extract pcilib->py bases from pcilib->py functions - add api for interact directly with pcilib->py without pcilib context. 3. pcipywrap - Add scripts handling. --- pcilib/py.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'pcilib/py.h') diff --git a/pcilib/py.h b/pcilib/py.h index c372a09..549eddf 100644 --- a/pcilib/py.h +++ b/pcilib/py.h @@ -118,6 +118,32 @@ int pcilib_py_eval_string(pcilib_t *ctx, const char *codestr, pcilib_value_t *va */ int pcilib_py_eval_func(pcilib_t *ctx, const char *script, const char *func, pcilib_value_t *val); + +/** Clone pcilib_py_t content without scripts hash + * @param[in] in - pcilib_py_t content to clone + * @param[out] err - error + * @return - NULL or cloned pcilib_py_t content pointer on success + */ +pcilib_py_t* pcilib_init_py_ctx(pcilib_py_t* in, int *err); +pcilib_py_object* pcilib_py_ctx_eval_func(pcilib_py_t *ctx_py, + const char *script_name, + const char *func_name, + pcilib_py_object *pyval, + int *err); +int pcilib_py_ctx_add_script_dir(pcilib_py_t *ctx_py, const char *dir); +void pcilib_free_py_ctx(pcilib_py_t *ctx_py); +int pcilib_py_ctx_load_script(pcilib_py_t *ctx_py, const char *script_name); +pcilib_py_object *pcilib_py_ctx_get_scripts_info(pcilib_py_t *ctx_py); + +/*! + * \brief Wrap for PyDict_SetItem, with decrease reference counting after set. + */ +void pcilib_pydict_set_item(pcilib_py_object* dict, pcilib_py_object* name, pcilib_py_object* value); + +/*! + * \brief Wrap for PyList_Append, with decrease reference counting after append. + */ +void pcilib_pylist_append(pcilib_py_object* list, pcilib_py_object* value); #ifdef __cplusplus } #endif -- cgit v1.2.3