mruby/c VM Source Code release 3.4
Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1
13
14#ifndef MRBC_SRC_ERROR_H_
15#define MRBC_SRC_ERROR_H_
16
17/***** Feature test switches ************************************************/
18/***** System headers *******************************************************/
19//@cond
20#include <stdint.h>
21//@endcond
22
23/***** Local headers ********************************************************/
24#include "value.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/***** Constat values *******************************************************/
31#if !defined(MRBC_EXCEPTION_CALL_NEST_LEVEL)
32#define MRBC_EXCEPTION_CALL_NEST_LEVEL 8
33#endif
34
35
36/***** Macros ***************************************************************/
37#define mrbc_israised(vm) ((vm)->exception.tt == MRBC_TT_EXCEPTION)
38
39
40/***** Typedefs *************************************************************/
41//================================================================
57
58
59/***** Global variables *****************************************************/
60/***** Function prototypes **************************************************/
61//@cond
62mrbc_value mrbc_exception_new(struct VM *vm, struct RClass *exc_cls, const void *message, int len);
63mrbc_value mrbc_exception_new_alloc(struct VM *vm, struct RClass *exc_cls, const void *message, int len);
65void mrbc_raise(struct VM *vm, struct RClass *exc_cls, const char *msg);
66void mrbc_raisef(struct VM *vm, struct RClass *exc_cls, const char *fstr, ...);
67void mrbc_clear_exception(struct VM *vm);
68void mrbc_print_exception(const mrbc_value *v);
69void mrbc_print_vm_exception(const struct VM *vm);
70//@endcond
71
72
73/***** Inline functions *****************************************************/
74
75
76#ifdef __cplusplus
77}
78#endif
79#endif
void mrbc_print_exception(const mrbc_value *v)
Definition error.c:219
void mrbc_raise(struct VM *vm, struct RClass *exc_cls, const char *msg)
Definition error.c:150
void mrbc_print_vm_exception(const struct VM *vm)
Definition error.c:236
void mrbc_exception_delete(mrbc_value *value)
Definition error.c:133
mrbc_value mrbc_exception_new_alloc(struct VM *vm, struct RClass *exc_cls, const void *message, int len)
Definition error.c:116
mrbc_value mrbc_exception_new(struct VM *vm, struct RClass *exc_cls, const void *message, int len)
Definition error.c:65
void mrbc_raisef(struct VM *vm, struct RClass *exc_cls, const char *fstr,...)
Definition error.c:173
void mrbc_clear_exception(struct VM *vm)
Definition error.c:206
#define MRBC_EXCEPTION_CALL_NEST_LEVEL
Definition error.h:32
struct RException mrbc_exception
Exception object.
Class object.
Definition class.h:83
Exception object.
Definition error.h:47
mrbc_sym call_nest[MRBC_EXCEPTION_CALL_NEST_LEVEL]
Definition error.h:54
struct RClass * cls
exception class.
Definition error.h:50
MRBC_OBJECT_HEADER
Definition error.h:48
const uint8_t * message
to heap or ROM.
Definition error.h:53
mrbc_sym method_id
raised method, if it is known.
Definition error.h:51
uint16_t message_size
message length.
Definition error.h:52
Virtual Machine.
Definition vm.h:140
mruby/c value definitions
int16_t mrbc_sym
mruby/c symbol ID
Definition value.h:59
struct RObject mrbc_value
Definition value.h:174