string.h: replace obsolete functions with macros.
mrb_string_value_ptr()
mrb_string_value_len()
MODIFY
include/mruby/string.h
include/mruby/string.h
@@ -331,9 +331,9 @@ MRB_API const char *mrb_string_cstr(mrb_state *mrb, mrb_value str);
/* NULL terminated C string from mrb_value; `str` will be updated */
MRB_API const char *mrb_string_value_cstr(mrb_state *mrb, mrb_value *str);
/* obsolete: use RSTRING_PTR() */
-MRB_API const char *mrb_string_value_ptr(mrb_state *mrb, mrb_value str);
+#define mrb_string_value_ptr(mrb, str) RSTRING_PTR(str)
/* obsolete: use RSTRING_LEN() */
-MRB_API mrb_int mrb_string_value_len(mrb_state *mrb, mrb_value str);
+#define mrb_string_value_len(mrb, str) RSTRING_LEN(str)
/* obsolete: substituted by a macro; shall be removed */
#define mrb_str_strlen(mrb, s) strlen(RSTR_PTR(s))

MODIFY
src/string.c
src/string.c
@@ -1019,22 +1019,6 @@ mrb_str_equal_m(mrb_state *mrb, mrb_value str1)
}
/* ---------------------------------- */
-/* obslete: use RSTRING_PTR() */
-MRB_API const char*
-mrb_string_value_ptr(mrb_state *mrb, mrb_value str)
-{
- str = mrb_obj_as_string(mrb, str);
- return RSTRING_PTR(str);
-}
-
-/* obslete: use RSTRING_LEN() */
-MRB_API mrb_int
-mrb_string_value_len(mrb_state *mrb, mrb_value ptr)
-{
- mrb_ensure_string_type(mrb, ptr);
- return RSTRING_LEN(ptr);
-}
-
MRB_API mrb_value
mrb_str_dup(mrb_state *mrb, mrb_value str)
{

string.h: replace obsolete functions with macros.

- mrb_string_value_ptr()
- mrb_string_value_len()