mbed I/F binding for mruby
Dependents: mruby_mbed_web mirb_mbed
mbed-mruby
How to use
Class
include/mruby/error.h@0:158c61bb030f, 2015-03-25 (annotated)
- Committer:
- mzta
- Date:
- Wed Mar 25 17:36:16 2015 +0000
- Revision:
- 0:158c61bb030f
mirb_mbed initial commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mzta | 0:158c61bb030f | 1 | /* |
mzta | 0:158c61bb030f | 2 | ** mruby/error.h - Exception class |
mzta | 0:158c61bb030f | 3 | ** |
mzta | 0:158c61bb030f | 4 | ** See Copyright Notice in mruby.h |
mzta | 0:158c61bb030f | 5 | */ |
mzta | 0:158c61bb030f | 6 | |
mzta | 0:158c61bb030f | 7 | #ifndef MRUBY_ERROR_H |
mzta | 0:158c61bb030f | 8 | #define MRUBY_ERROR_H |
mzta | 0:158c61bb030f | 9 | |
mzta | 0:158c61bb030f | 10 | #if defined(__cplusplus) |
mzta | 0:158c61bb030f | 11 | extern "C" { |
mzta | 0:158c61bb030f | 12 | #endif |
mzta | 0:158c61bb030f | 13 | |
mzta | 0:158c61bb030f | 14 | struct RException { |
mzta | 0:158c61bb030f | 15 | MRB_OBJECT_HEADER; |
mzta | 0:158c61bb030f | 16 | struct iv_tbl *iv; |
mzta | 0:158c61bb030f | 17 | }; |
mzta | 0:158c61bb030f | 18 | |
mzta | 0:158c61bb030f | 19 | #define mrb_exc_ptr(v) ((struct RException*)mrb_ptr(v)) |
mzta | 0:158c61bb030f | 20 | |
mzta | 0:158c61bb030f | 21 | MRB_API void mrb_sys_fail(mrb_state *mrb, const char *mesg); |
mzta | 0:158c61bb030f | 22 | MRB_API mrb_value mrb_exc_new_str(mrb_state *mrb, struct RClass* c, mrb_value str); |
mzta | 0:158c61bb030f | 23 | #define mrb_exc_new_str_lit(mrb, c, lit) mrb_exc_new_str(mrb, c, mrb_str_new_lit(mrb, lit)) |
mzta | 0:158c61bb030f | 24 | MRB_API mrb_value mrb_make_exception(mrb_state *mrb, int argc, const mrb_value *argv); |
mzta | 0:158c61bb030f | 25 | MRB_API mrb_value mrb_exc_backtrace(mrb_state *mrb, mrb_value exc); |
mzta | 0:158c61bb030f | 26 | MRB_API mrb_value mrb_get_backtrace(mrb_state *mrb); |
mzta | 0:158c61bb030f | 27 | MRB_API mrb_noreturn void mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_int argc, const mrb_value *argv, const char *fmt, ...); |
mzta | 0:158c61bb030f | 28 | |
mzta | 0:158c61bb030f | 29 | /* declaration for fail method */ |
mzta | 0:158c61bb030f | 30 | MRB_API mrb_value mrb_f_raise(mrb_state*, mrb_value); |
mzta | 0:158c61bb030f | 31 | |
mzta | 0:158c61bb030f | 32 | #if defined(__cplusplus) |
mzta | 0:158c61bb030f | 33 | } /* extern "C" { */ |
mzta | 0:158c61bb030f | 34 | #endif |
mzta | 0:158c61bb030f | 35 | |
mzta | 0:158c61bb030f | 36 | #endif /* MRUBY_ERROR_H */ |
mzta | 0:158c61bb030f | 37 |