diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-04-25 19:28:12 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-04-25 19:31:17 +0300 |
commit | 6d103b65482d8dc1d688fcfd59b3400ebfbe0f0f (patch) | |
tree | dc407b8c1aaeb9ac5d85f1110be7c487972cf275 /py/runtime.h | |
parent | 104aa26271d38fc6204fcee6d65044716e4dae31 (diff) |
py: Move call_function_*_protected() functions to py/ for reuse.
They almost certainly needed by any C code which calls Python callbacks.
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h index 1b58f4728..3e325a31b 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -95,6 +95,9 @@ mp_obj_t mp_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); mp_obj_t mp_call_function_n_kw(mp_obj_t fun, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); mp_obj_t mp_call_method_n_kw(mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args); mp_obj_t mp_call_method_n_kw_var(bool have_self, mp_uint_t n_args_n_kw, const mp_obj_t *args); +// Call function and catch/dump exception - for Python callbacks from C code +void mp_call_function_1_protected(mp_obj_t fun, mp_obj_t arg); +void mp_call_function_2_protected(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); typedef struct _mp_call_args_t { mp_obj_t fun; |