Feature #905 ยป string_buffer.diff
string.c (working copy) | ||
---|---|---|
return rb_str_substr(str, 0, 1);
|
||
}
|
||
static VALUE
|
||
rb_str_set_buffer(VALUE str, VALUE length)
|
||
{
|
||
long size = NUM2LONG(length);
|
||
rb_str_modify(str);
|
||
RESIZE_CAPA(str, size);
|
||
return str;
|
||
}
|
||
/*
|
||
* call-seq:
|
||
* str.getbyte(index) => 0 .. 255
|
||
... | ... | |
rb_define_method(rb_cString, "clear", rb_str_clear, 0);
|
||
rb_define_method(rb_cString, "chr", rb_str_chr, 0);
|
||
rb_define_method(rb_cString, "getbyte", rb_str_getbyte, 1);
|
||
rb_define_method(rb_cString, "buffer", rb_str_set_buffer, 1);
|
||
rb_define_method(rb_cString, "setbyte", rb_str_setbyte, 2);
|
||
rb_define_method(rb_cString, "to_i", rb_str_to_i, -1);
|