From eb0e3fe78fa5338299fde5e5263121df1a64493c Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 19 Sep 2014 05:53:05 +0000 Subject: intern.h: rb_str_new_literal * include/ruby/intern.h (rb_str_new_literal): make ruby string from literal C-string. incorporated from mruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- README.EXT | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'README.EXT') diff --git a/README.EXT b/README.EXT index f4e4a20d14..9f5c1a83fc 100644 --- a/README.EXT +++ b/README.EXT @@ -184,6 +184,10 @@ rb_str_new_cstr(const char *ptr) :: Creates a new Ruby string from a C string. This is equivalent to rb_str_new(ptr, strlen(ptr)). +rb_str_new_literal(const char *ptr) :: + + Creates a new Ruby string from a C string literal. + rb_tainted_str_new(const char *ptr, long len) :: Creates a new tainted Ruby string. Strings from external data @@ -226,16 +230,31 @@ rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc) :: Creates a new Ruby string with the specified encoding. +rb_enc_str_new_literal(const char *ptr) :: + + Creates a new Ruby string from a C string literal with the specified + encoding. + rb_usascii_str_new(const char *ptr, long len) :: rb_usascii_str_new_cstr(const char *ptr) :: Creates a new Ruby string with encoding US-ASCII. +rb_usascii_str_new_literal(const char *ptr) :: + + Creates a new Ruby string from a C string literal with encoding + US-ASCII. + rb_utf8_str_new(const char *ptr, long len) :: rb_utf8_str_new_cstr(const char *ptr) :: Creates a new Ruby string with encoding UTF-8. +rb_utf8_str_new_literal(const char *ptr) :: + + Creates a new Ruby string from a C string literal with encoding + UTF-8. + rb_str_resize(VALUE str, long len) :: Resizes Ruby string to len bytes. If str is not modifiable, this -- cgit v1.2.3