summaryrefslogtreecommitdiff
path: root/README.EXT
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-03 01:55:10 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-03 01:55:10 (GMT)
commitd0987afc748dca7c2cab11011a5ee4b86bb59ba0 (patch)
tree53cb108158057282856ca15d4523c9dd712079ae /README.EXT
parent48bb55edc95bbfd9e3c0f6deac034e7aea3200bc (diff)
make symbol conversion functions public
* include/ruby/encoding.h (rb_check_symbol_cstr): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'README.EXT')
-rw-r--r--README.EXT10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.EXT b/README.EXT
index 756f46f..bfea600 100644
--- a/README.EXT
+++ b/README.EXT
@@ -482,6 +482,16 @@ 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 retrieve Symbol from Ruby object (Symbol or String) given as
+an argument by using
+
+ rb_to_symbol(VALUE name)
+ rb_check_symbol(volatile VALUE *namep)
+ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc)
+
+These functions are similar to above functions except that these
+return a Symbol instead of an ID.
+
You can convert C ID to Ruby Symbol by using
VALUE ID2SYM(ID id)