summaryrefslogtreecommitdiff
path: root/py/runtime.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-25 19:28:12 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-25 19:31:17 +0300
commit6d103b65482d8dc1d688fcfd59b3400ebfbe0f0f (patch)
treedc407b8c1aaeb9ac5d85f1110be7c487972cf275 /py/runtime.h
parent104aa26271d38fc6204fcee6d65044716e4dae31 (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.h3
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;