summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mruby.h2
-rw-r--r--include/mruby/boxing_word.h10
-rw-r--r--include/mruby/error.h7
-rw-r--r--include/mruby/object.h10
-rw-r--r--include/mruby/value.h3
-rw-r--r--include/mruby/variable.h2
6 files changed, 23 insertions, 11 deletions
diff --git a/include/mruby.h b/include/mruby.h
index d91e024d1..c4466de4c 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -112,6 +112,7 @@ typedef struct mrb_state {
struct mrb_jmpbuf *jmp;
mrb_allocf allocf; /* memory allocation function */
+ void *allocf_ud; /* auxiliary data of allocf */
struct mrb_context *c;
struct mrb_context *root_c;
@@ -385,6 +386,7 @@ void mrb_print_error(mrb_state *mrb);
#define E_SYNTAX_ERROR (mrb_class_get(mrb, "SyntaxError"))
#define E_LOCALJUMP_ERROR (mrb_class_get(mrb, "LocalJumpError"))
#define E_REGEXP_ERROR (mrb_class_get(mrb, "RegexpError"))
+#define E_SYSSTACK_ERROR (mrb_class_get(mrb, "SystemStackError"))
#define E_NOTIMP_ERROR (mrb_class_get(mrb, "NotImplementedError"))
#define E_FLOATDOMAIN_ERROR (mrb_class_get(mrb, "FloatDomainError"))
diff --git a/include/mruby/boxing_word.h b/include/mruby/boxing_word.h
index 6057311a8..92e6ae6de 100644
--- a/include/mruby/boxing_word.h
+++ b/include/mruby/boxing_word.h
@@ -11,6 +11,16 @@
# error MRB_INT16 is too small for MRB_WORD_BOXING.
#endif
+struct RFloat {
+ MRB_OBJECT_HEADER;
+ mrb_float f;
+};
+
+struct RCptr {
+ MRB_OBJECT_HEADER;
+ void *p;
+};
+
#define MRB_FIXNUM_SHIFT 1
#define MRB_TT_HAS_BASIC MRB_TT_FLOAT
diff --git a/include/mruby/error.h b/include/mruby/error.h
index 4d37f1701..210ae3449 100644
--- a/include/mruby/error.h
+++ b/include/mruby/error.h
@@ -11,6 +11,13 @@
extern "C" {
#endif
+struct RException {
+ MRB_OBJECT_HEADER;
+ struct iv_tbl *iv;
+};
+
+#define mrb_exc_ptr(v) ((struct RException*)mrb_ptr(v))
+
void mrb_sys_fail(mrb_state *mrb, const char *mesg);
mrb_value mrb_exc_new_str(mrb_state *mrb, struct RClass* c, mrb_value str);
#define mrb_exc_new_str_lit(mrb, c, lit) mrb_exc_new_str(mrb, c, mrb_str_new_lit(mrb, lit))
diff --git a/include/mruby/object.h b/include/mruby/object.h
index f6a9f4081..56917a021 100644
--- a/include/mruby/object.h
+++ b/include/mruby/object.h
@@ -55,14 +55,4 @@ struct RFiber {
struct mrb_context *cxt;
};
-struct RFloat {
- MRB_OBJECT_HEADER;
- mrb_float f;
-};
-
-struct RCptr {
- MRB_OBJECT_HEADER;
- void *p;
-};
-
#endif /* MRUBY_OBJECT_H */
diff --git a/include/mruby/value.h b/include/mruby/value.h
index f16fa20a6..ae75f9c23 100644
--- a/include/mruby/value.h
+++ b/include/mruby/value.h
@@ -122,6 +122,7 @@ enum mrb_vtype {
#define mrb_string_p(o) (mrb_type(o) == MRB_TT_STRING)
#define mrb_hash_p(o) (mrb_type(o) == MRB_TT_HASH)
#define mrb_cptr_p(o) (mrb_type(o) == MRB_TT_CPTR)
+#define mrb_exception_p(o) (mrb_type(o) == MRB_TT_EXCEPTION)
#define mrb_test(o) mrb_bool(o)
mrb_bool mrb_regexp_p(struct mrb_state*, mrb_value);
@@ -129,6 +130,7 @@ static inline mrb_value
mrb_float_value(struct mrb_state *mrb, mrb_float f)
{
mrb_value v;
+ (void) mrb;
SET_FLOAT_VALUE(mrb, v, f);
return v;
}
@@ -137,6 +139,7 @@ static inline mrb_value
mrb_cptr_value(struct mrb_state *mrb, void *p)
{
mrb_value v;
+ (void) mrb;
SET_CPTR_VALUE(mrb,v,p);
return v;
}
diff --git a/include/mruby/variable.h b/include/mruby/variable.h
index 68a4e5889..f3bf6ac8e 100644
--- a/include/mruby/variable.h
+++ b/include/mruby/variable.h
@@ -48,7 +48,7 @@ void mrb_iv_set(mrb_state *mrb, mrb_value obj, mrb_sym sym, mrb_value v);
mrb_bool mrb_iv_defined(mrb_state*, mrb_value, mrb_sym);
mrb_value mrb_iv_remove(mrb_state *mrb, mrb_value obj, mrb_sym sym);
void mrb_iv_copy(mrb_state *mrb, mrb_value dst, mrb_value src);
-int mrb_const_defined_at(mrb_state *mrb, struct RClass *klass, mrb_sym id);
+mrb_bool mrb_const_defined_at(mrb_state *mrb, struct RClass *klass, mrb_sym id);
mrb_value mrb_mod_constants(mrb_state *mrb, mrb_value mod);
mrb_value mrb_f_global_variables(mrb_state *mrb, mrb_value self);
mrb_value mrb_gv_get(mrb_state *mrb, mrb_sym sym);