summaryrefslogtreecommitdiff
path: root/README.EXT
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-26 07:01:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-26 07:01:14 +0000
commite9b5878c4168ec6b5ed5129d897ee9be7636ca71 (patch)
tree9229296296e4a89f45b3d416b30559ee75768d44 /README.EXT
parent8478ba513fd23c72b99790144be4fa17ebef3b35 (diff)
* eval.c (avalue_splat): new function to do unary * (splat)
operator. * eval.c (avalue_to_svalue,svalue_to_avalue,svalue_to_mrhs): do not use implicit "to_ary" conversion. * ext/curses/curses.c (GetWINDOW,GetMOUSE): add taint check. * ext/curses/curses.c (curses_init_screen): ditto. * ext/curses/curses.c (window_initialize): ditto. * gc.c (os_each_obj): prohibit ObjectSpace#each_object in safe mode ($SAFE >= 4). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'README.EXT')
-rw-r--r--README.EXT17
1 files changed, 14 insertions, 3 deletions
diff --git a/README.EXT b/README.EXT
index 4bbe120..97e5793 100644
--- a/README.EXT
+++ b/README.EXT
@@ -94,9 +94,20 @@ The T_FIXNUM data is a 31bit length fixed integer (63bit length on
some machines), which can be convert to a C integer by using the
FIX2INT() macro. There is also NUM2INT() which converts any Ruby
numbers into C integers. The NUM2INT() macro includes a type check, so
-an exception will be raised if the conversion failed. There are also
-a macro NUM2DBL() to retrieve the double float value and STR2CSTR() is
-useful to get the string as char*.
+an exception will be raised if the conversion failed. NUM2DBL() can
+be used to retrieve the double float value in same way.
+
+To get char* from a VALUE, version 1.7 recommend to use new macros
+StringValue() and StringValuePtr(). StringValue(var) replaces var's
+value to the result of "var.to_str()". StringValuePtr(var) does same
+replacement and returns char* representation of var. These macros
+will skip the replacement if var is a String. Notice that the macros
+requires to take only lvalue as their argument, to change the value
+of var in the replacement.
+
+In version 1.6 or earlier, STR2CSTR() was used to do same thing
+but now it is obsoleted in version 1.7 because of STR2CSTR() has
+a risk of dangling pointer problem in to_str() impliclit conversion.
Other data types have corresponding C structures, e.g. struct RArray
for T_ARRAY etc. The VALUE of the type which has corresponding structure