From 3a32ef53aaab15199e59c643630726b041c9fa88 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 5 Aug 2010 11:14:05 +0000 Subject: * README.EXT, README.EXT.ja (String functions): mention rb_str_resize and rb_str_set_len. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- README.EXT | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'README.EXT') diff --git a/README.EXT b/README.EXT index 72dba58c5d..ac0d7cc98d 100644 --- a/README.EXT +++ b/README.EXT @@ -223,6 +223,23 @@ listed below: Creates a new Ruby string with encoding US-ASCII. + rb_str_resize(VALUE str, long len) + + Resizes Ruby string to len bytes. If str is not modifiable, this + function raises an exception. The length of str must be set in + advance. If len is less than the old length the content beyond + len bytes is discarded, else if len is greater than the old length + the content beyond the old length bytes will not be preserved but + will be garbage. Note that RSTRING_PTR(str) may change by calling + this function. + + rb_str_set_len(VALUE str, long len) + + Sets the length of Ruby string. If str is not modifiable, this + function raises an exception. This function preserves the content + upto len bytes, regardless RSTRING_LEN(str). len must not exceed + the capacity of str. + Array functions rb_ary_new() -- cgit v1.2.3