summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-16 03:36:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-16 03:36:47 +0000
commit3636e08858f62050b610b1eaa2f0d9d7a158a612 (patch)
tree16c839b9b24bc413beb4b75e0de849e3763053a9 /string.c
parenta669514e63211642cbe111dbe64412be0308ef5b (diff)
downloadruby-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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/string.c b/string.c
index 470cb9a4d1..25305a4a4d 100644
--- a/string.c
+++ b/string.c
@@ -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;