diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-08 07:46:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-08 07:46:39 +0000 |
commit | 18034276608ec2c61198e7e38065997d47cf3725 (patch) | |
tree | 4af95913ee21d5aac93eda434340cd28a33adba1 /symbol.c | |
parent | bdc2876597a30f133ccca65a3be37345fcb2e710 (diff) |
symbol.c: rb_cstr_intern
* symbol.c (rb_cstr_intern): new function to make Symbol object
like as rb_str_intern() but from pointer to the name, its length
and its encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r-- | symbol.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1013,6 +1013,14 @@ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc) return Qnil; } +VALUE +rb_cstr_intern(const char *ptr, long len, rb_encoding *enc) +{ + struct RString fake_str; + const VALUE name = rb_setup_fake_str(&fake_str, ptr, len, enc); + return rb_str_intern(name); +} + static ID attrsetname_to_attr_id(VALUE name) { |