Merge branch 'pluggable_struct' of https://github.com/mattn/mruby into mattn-pluggable_struct

This commit is contained in:
Yukihiro Matz Matsumoto
2013-03-01 21:38:02 +09:00
12 changed files with 61 additions and 102 deletions
-27
View File
@@ -1,27 +0,0 @@
/*
** mruby/struct.h - Struct class
**
** See Copyright Notice in mruby.h
*/
#ifndef MRUBY_STRUCT_H
#define MRUBY_STRUCT_H
#if defined(__cplusplus)
extern "C" {
#endif
struct RStruct {
struct RBasic basic;
long len;
mrb_value *ptr;
};
#define RSTRUCT(st) ((struct RStruct*)((st).value.p))
#define RSTRUCT_LEN(st) ((int)(RSTRUCT(st)->len))
#define RSTRUCT_PTR(st) (RSTRUCT(st)->ptr)
#if defined(__cplusplus)
} /* extern "C" { */
#endif
#endif /* MRUBY_STRUCT_H */
+10 -12
View File
@@ -29,12 +29,11 @@ enum mrb_vtype {
MRB_TT_HASH, /* 16 */
MRB_TT_STRING, /* 17 */
MRB_TT_RANGE, /* 18 */
MRB_TT_STRUCT, /* 19 */
MRB_TT_EXCEPTION, /* 20 */
MRB_TT_FILE, /* 21 */
MRB_TT_ENV, /* 22 */
MRB_TT_DATA, /* 23 */
MRB_TT_MAXDEFINE /* 24 */
MRB_TT_EXCEPTION, /* 19 */
MRB_TT_FILE, /* 20 */
MRB_TT_ENV, /* 21 */
MRB_TT_DATA, /* 22 */
MRB_TT_MAXDEFINE /* 23 */
};
typedef struct mrb_value {
@@ -89,12 +88,11 @@ enum mrb_vtype {
MRB_TT_HASH, /* 17 */
MRB_TT_STRING, /* 18 */
MRB_TT_RANGE, /* 19 */
MRB_TT_STRUCT, /* 20 */
MRB_TT_EXCEPTION, /* 21 */
MRB_TT_FILE, /* 22 */
MRB_TT_ENV, /* 23 */
MRB_TT_DATA, /* 24 */
MRB_TT_MAXDEFINE /* 25 */
MRB_TT_EXCEPTION, /* 20 */
MRB_TT_FILE, /* 21 */
MRB_TT_ENV, /* 22 */
MRB_TT_DATA, /* 23 */
MRB_TT_MAXDEFINE /* 24 */
};
#ifdef MRB_ENDIAN_BIG