replace _cstr by _lit for litral C strings; ref #3300

This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-11-27 20:53:25 +09:00
parent 3d9aa463f7
commit f9f19f34dd
3 changed files with 15 additions and 15 deletions
+6 -6
View File
@@ -110,8 +110,8 @@ MRB_API void mrb_str_modify(mrb_state*, struct RString*);
* }
*
* // Creates new Ruby strings.
* str1 = mrb_str_new_cstr(mrb, "abc");
* str2 = mrb_str_new_cstr(mrb, "def");
* str1 = mrb_str_new_lit(mrb, "abc");
* str2 = mrb_str_new_lit(mrb, "def");
*
* // Concatnates str2 to str1.
* mrb_str_concat(mrb, str1, str2);
@@ -158,8 +158,8 @@ MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value);
* }
*
* // Creates two Ruby strings from the passed in C strings.
* a = mrb_str_new_cstr(mrb, "abc");
* b = mrb_str_new_cstr(mrb, "def");
* a = mrb_str_new_lit(mrb, "abc");
* b = mrb_str_new_lit(mrb, "def");
*
* // Prints both C strings.
* mrb_p(mrb, a);
@@ -227,7 +227,7 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
* // handle error
* }
* // Creates a new string.
* str = mrb_str_new_cstr(mrb, "Hello, world!");
* str = mrb_str_new_lit(mrb, "Hello, world!");
* // Returns 5 characters of
* mrb_str_resize(mrb, str, 5);
* mrb_p(mrb, str);
@@ -267,7 +267,7 @@ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
* // handle error
* }
* // Creates new string.
* str1 = mrb_str_new_cstr(mrb, "Hello, world!");
* str1 = mrb_str_new_lit(mrb, "Hello, world!");
* // Returns a sub-string within the range of 0..2
* str2 = mrb_str_substr(mrb, str1, 0, 2);
*