staticVALUErb_str_setbyte(VALUEstr,VALUEindex,VALUEvalue){longpos=NUM2LONG(index);intbyte=NUM2INT(value);rb_str_modify(str);if(pos<-RSTRING_LEN(str)||RSTRING_LEN(str)<=pos)rb_raise(rb_eIndexError,"index %ld out of string",pos);if(pos<0)pos+=RSTRING_LEN(str);RSTRING_PTR(str)[pos]=byte;returnvalue;}