diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-03-01 10:42:40 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-03-01 10:42:40 +0100 |
commit | 5d775d64bdec554b9842823bd1c46263210425fd (patch) | |
tree | cb1da12066687273f7dccace7aba4ee1ff2ba25c /pcilib/py.h | |
parent | 0e584d07a0776454fd5487b7d23407c0624b56c2 (diff) | |
download | pcitool-5d775d64bdec554b9842823bd1c46263210425fd.tar.gz pcitool-5d775d64bdec554b9842823bd1c46263210425fd.tar.bz2 pcitool-5d775d64bdec554b9842823bd1c46263210425fd.tar.xz pcitool-5d775d64bdec554b9842823bd1c46263210425fd.zip |
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.
Diffstat (limited to 'pcilib/py.h')
-rw-r--r-- | pcilib/py.h | 26 |
1 files changed, 26 insertions, 0 deletions
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 |