diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-11 13:31:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-11 13:31:23 +0000 |
commit | db5265a82c221887faf0dfd0d04e47cf11a08e3a (patch) | |
tree | a8d54a47508d0e890f102faa4705ce73562f0941 /README.EXT | |
parent | a5d1da5d74560c812acb8db6242e389d2f27e368 (diff) |
* parse.y (rb_check_id_cstr): new function to check if ID is
registered with NUL-terminated C string.
* sprintf.c (rb_str_format): avoid inadvertent symbol creation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'README.EXT')
-rw-r--r-- | README.EXT | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/README.EXT b/README.EXT index ad45255bca..8368a94708 100644 --- a/README.EXT +++ b/README.EXT @@ -452,12 +452,14 @@ argument by using rb_to_id(VALUE symbol) rb_check_id(volatile VALUE *name) + rb_check_id_cstr(const char *name, long len, rb_encoding *enc) These functions try to convert the argument to a String if it was not -a Symbol nor a String. The latter function stores the converted +a Symbol nor a String. The second function stores the converted result into *name, and returns 0 if the string is not a known symbol. After this function returned a non-zero value, *name is always a Symbol or a String, otherwise it is a String if the result is 0. +The third function takes NUL-terminated C string, not Ruby VALUE. You can convert C ID to Ruby Symbol by using |