Index: EcnlProtoTool/trunk/mruby-2.1.1/include/mruby/class.h
===================================================================
--- EcnlProtoTool/trunk/mruby-1.3.0/include/mruby/class.h	(revision 331)
+++ EcnlProtoTool/trunk/mruby-2.1.1/include/mruby/class.h	(revision 439)
@@ -1,4 +1,4 @@
-/*
-** mruby/class.h - Class class
+/**
+** @file mruby/class.h - Class class
 **
 ** See Copyright Notice in mruby.h
@@ -23,9 +23,6 @@
 
 #define mrb_class_ptr(v)    ((struct RClass*)(mrb_ptr(v)))
-#define RCLASS_SUPER(v)     (((struct RClass*)(mrb_ptr(v)))->super)
-#define RCLASS_IV_TBL(v)    (((struct RClass*)(mrb_ptr(v)))->iv)
-#define RCLASS_M_TBL(v)     (((struct RClass*)(mrb_ptr(v)))->mt)
 
-static inline struct RClass*
+MRB_INLINE struct RClass*
 mrb_class(mrb_state *mrb, mrb_value v)
 {
@@ -41,6 +38,8 @@
   case MRB_TT_FIXNUM:
     return mrb->fixnum_class;
+#ifndef MRB_WITHOUT_FLOAT
   case MRB_TT_FLOAT:
     return mrb->float_class;
+#endif
   case MRB_TT_CPTR:
     return mrb->object_class;
@@ -52,38 +51,55 @@
 }
 
-/* TODO: figure out where to put user flags */
-#define MRB_FLAG_IS_FROZEN (1 << 18)
-#define MRB_FLAG_IS_PREPENDED (1 << 19)
-#define MRB_FLAG_IS_ORIGIN (1 << 20)
+/* flags:
+   20: frozen
+   19: is_prepended
+   18: is_origin
+   17: is_inherited (used by method cache)
+   16: unused
+   0-15: instance type
+*/
+#define MRB_FL_CLASS_IS_PREPENDED (1 << 19)
+#define MRB_FL_CLASS_IS_ORIGIN (1 << 18)
 #define MRB_CLASS_ORIGIN(c) do {\
-  if (c->flags & MRB_FLAG_IS_PREPENDED) {\
-    c = c->super;\
-    while (!(c->flags & MRB_FLAG_IS_ORIGIN)) {\
-      c = c->super;\
+  if ((c)->flags & MRB_FL_CLASS_IS_PREPENDED) {\
+    (c) = (c)->super;\
+    while (!((c)->flags & MRB_FL_CLASS_IS_ORIGIN)) {\
+      (c) = (c)->super;\
     }\
   }\
 } while (0)
+#define MRB_FL_CLASS_IS_INHERITED (1 << 17)
 #define MRB_INSTANCE_TT_MASK (0xFF)
-#define MRB_SET_INSTANCE_TT(c, tt) c->flags = ((c->flags & ~MRB_INSTANCE_TT_MASK) | (char)tt)
-#define MRB_INSTANCE_TT(c) (enum mrb_vtype)(c->flags & MRB_INSTANCE_TT_MASK)
+#define MRB_SET_INSTANCE_TT(c, tt) ((c)->flags = (((c)->flags & ~MRB_INSTANCE_TT_MASK) | (char)(tt)))
+#define MRB_INSTANCE_TT(c) (enum mrb_vtype)((c)->flags & MRB_INSTANCE_TT_MASK)
 
 MRB_API struct RClass* mrb_define_class_id(mrb_state*, mrb_sym, struct RClass*);
 MRB_API struct RClass* mrb_define_module_id(mrb_state*, mrb_sym);
-MRB_API struct RClass *mrb_vm_define_class(mrb_state*, mrb_value, mrb_value, mrb_sym);
-MRB_API struct RClass *mrb_vm_define_module(mrb_state*, mrb_value, mrb_sym);
-MRB_API void mrb_define_method_raw(mrb_state*, struct RClass*, mrb_sym, struct RProc *);
+struct RClass *mrb_vm_define_class(mrb_state*, mrb_value, mrb_value, mrb_sym);
+struct RClass *mrb_vm_define_module(mrb_state*, mrb_value, mrb_sym);
+MRB_API void mrb_define_method_raw(mrb_state*, struct RClass*, mrb_sym, mrb_method_t);
 MRB_API void mrb_define_method_id(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t func, mrb_aspec aspec);
-MRB_API void mrb_alias_method(mrb_state *mrb, struct RClass *c, mrb_sym a, mrb_sym b);
+MRB_API void mrb_alias_method(mrb_state*, struct RClass *c, mrb_sym a, mrb_sym b);
 
-MRB_API struct RClass *mrb_class_outer_module(mrb_state*, struct RClass *);
-MRB_API struct RProc *mrb_method_search_vm(mrb_state*, struct RClass**, mrb_sym);
-MRB_API struct RProc *mrb_method_search(mrb_state*, struct RClass*, mrb_sym);
+MRB_API mrb_method_t mrb_method_search_vm(mrb_state*, struct RClass**, mrb_sym);
+MRB_API mrb_method_t mrb_method_search(mrb_state*, struct RClass*, mrb_sym);
 
 MRB_API struct RClass* mrb_class_real(struct RClass* cl);
+mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv);
 
+void mrb_class_name_class(mrb_state*, struct RClass*, struct RClass*, mrb_sym);
+mrb_bool mrb_const_name_p(mrb_state*, const char*, mrb_int);
+mrb_value mrb_class_find_path(mrb_state*, struct RClass*);
+mrb_value mrb_mod_to_s(mrb_state*, mrb_value);
 void mrb_gc_mark_mt(mrb_state*, struct RClass*);
 size_t mrb_gc_mark_mt_size(mrb_state*, struct RClass*);
 void mrb_gc_free_mt(mrb_state*, struct RClass*);
 
+#ifdef MRB_METHOD_CACHE
+void mrb_mc_clear_by_class(mrb_state *mrb, struct RClass* c);
+#else
+#define mrb_mc_clear_by_class(mrb,c)
+#endif
+
 MRB_END_DECL
 
