diff options
| author | take_cheeze <[email protected]> | 2015-06-22 00:05:45 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2015-07-15 14:46:56 +0900 |
| commit | cdd72d9c3783749c979edf62522cf9636681538d (patch) | |
| tree | fbedcf59fc7176d7e6b82adf20170e44b3787a98 /include | |
| parent | 2e4bc2de8889a321fbde9898bc9afc9daefd8f76 (diff) | |
| download | mruby-cdd72d9c3783749c979edf62522cf9636681538d.tar.gz mruby-cdd72d9c3783749c979edf62522cf9636681538d.zip | |
Implement `mrb_protect`, `mrb_ensure`, `mrb_rescue`, `mrb_rescue_exceptions`.
(`mrb_rescue_exceptions` is mruby implementation of `rb_rescue2`.)
Closes #2844, closes #2837.
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/error.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mruby/error.h b/include/mruby/error.h index 282be0a24..3a985236a 100644 --- a/include/mruby/error.h +++ b/include/mruby/error.h @@ -29,6 +29,14 @@ MRB_API mrb_noreturn void mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_va /* declaration for fail method */ MRB_API mrb_value mrb_f_raise(mrb_state*, mrb_value); +MRB_API mrb_value mrb_protect(mrb_state *mrb, mrb_func_t body, mrb_value data, mrb_bool *state); +MRB_API mrb_value mrb_ensure(mrb_state *mrb, mrb_func_t body, mrb_value b_data, + mrb_func_t ensure, mrb_value e_data); +MRB_API mrb_value mrb_rescue(mrb_state *mrb, mrb_func_t body, mrb_value b_data, + mrb_func_t rescue, mrb_value r_data); +MRB_API mrb_value mrb_rescue_exceptions(mrb_state *mrb, mrb_func_t body, mrb_value b_data, + mrb_func_t rescue, mrb_value r_data, ...); + #if defined(__cplusplus) } /* extern "C" { */ #endif |
