summaryrefslogtreecommitdiff
path: root/ruby.h
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-03 10:16:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-03 10:16:14 +0000
commit369124b0ec6aa0d58ea628339713444c559bfa5f (patch)
tree69b7aaee156382355dbde6cd1302bb73d2e3e6c9 /ruby.h
parent0861165bdcef50bb504526153d87d8e0a7be0140 (diff)
shugo's method etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.h')
-rw-r--r--ruby.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/ruby.h b/ruby.h
index 97c7510..9f8ede3 100644
--- a/ruby.h
+++ b/ruby.h
@@ -172,6 +172,10 @@ double num2dbl _((VALUE));
char *str2cstr _((VALUE));
#define STR2CSTR(x) str2cstr((VALUE)(x))
+#define NUM2CHR(x) (((TYPE(x) == T_STRING)&&(RSTRING(x)->len>=1))?\
+ RSTRING(x)->ptr[0]:(char)NUM2INT(x))
+#define CHR2FIX(x) INT2FIX((int)x)
+
VALUE rb_newobj _((void));
#define NEWOBJ(obj,type) type *obj = (type*)rb_newobj()
#define OBJSETUP(obj,c,t) {\
@@ -290,11 +294,11 @@ struct RBignum {
#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
#define RFILE(obj) (R_CAST(RFile)(obj))
-#define FL_SINGLETON (1<<8)
-#define FL_MARK (1<<9)
-#define FL_FINALIZE (1<<10)
+#define FL_SINGLETON FL_USER0
+#define FL_MARK (1<<8)
+#define FL_FINALIZE (1<<9)
-#define FL_USHIFT 11
+#define FL_USHIFT 10
#define FL_USER0 (1<<(FL_USHIFT+0))
#define FL_USER1 (1<<(FL_USHIFT+1))
@@ -303,8 +307,9 @@ struct RBignum {
#define FL_USER4 (1<<(FL_USHIFT+4))
#define FL_USER5 (1<<(FL_USHIFT+5))
#define FL_USER6 (1<<(FL_USHIFT+6))
+#define FL_USER7 (1<<(FL_USHIFT+7))
-#define FL_UMASK (0x7f<<FL_USHIFT)
+#define FL_UMASK (0xff<<FL_USHIFT)
#define FL_ABLE(x) (!(FIXNUM_P(x)||rb_special_const_p((VALUE)(x))))
#define FL_TEST(x,f) (FL_ABLE(x)?(RBASIC(x)->flags&(f)):0)