diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-16 03:36:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-16 03:36:47 +0000 |
commit | 3636e08858f62050b610b1eaa2f0d9d7a158a612 (patch) | |
tree | 16c839b9b24bc413beb4b75e0de849e3763053a9 /string.c | |
parent | a669514e63211642cbe111dbe64412be0308ef5b (diff) | |
download | ruby-3636e08858f62050b610b1eaa2f0d9d7a158a612.tar.gz |
string.c: rb_setup_fake_str
* string.c (rb_setup_fake_str): setup fake string from C pointer,
length, and encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -248,6 +248,12 @@ setup_fake_str(struct RString *fake_str, const char *name, long len, int encidx) } VALUE +rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc) +{ + return setup_fake_str(fake_str, name, len, rb_enc_to_index(enc)); +} + +VALUE rb_fstring_new(const char *ptr, long len) { struct RString fake_str; |