From 95013cd5c0196f7a7fb0261594dcb74e3588af42 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 18 Apr 2014 12:42:04 +0000 Subject: README.EXT: about string termination * README.EXT (Appendix B): add RSTRING_PTR and RSTRING_LEN. and NULL-termination by StringValueCStr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- README.EXT | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'README.EXT') diff --git a/README.EXT b/README.EXT index 6ba0e6fec6..a60d559092 100644 --- a/README.EXT +++ b/README.EXT @@ -1081,6 +1081,15 @@ rb_float_new(f) :: double -> Float +RSTRING_LEN(str) :: + + String -> length of String data in bytes + +RSTRING_PTR(str) :: + + String -> pointer to String data + Note that the result pointer may not be NULL-terminated + StringValue(value) :: Object with #to_str -> String @@ -1092,6 +1101,7 @@ StringValuePtr(value) :: StringValueCStr(value) :: Object with #to_str -> pointer to String data without NULL bytes + It is guaranteed that the result data is NULL-terminated rb_str_new2(s) :: -- cgit v1.2.1