From d0987afc748dca7c2cab11011a5ee4b86bb59ba0 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 3 Aug 2014 01:55:10 +0000 Subject: 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 --- README.EXT | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'README.EXT') diff --git a/README.EXT b/README.EXT index 756f46f98b..bfea6001c2 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) -- cgit v1.2.3