/* * call-seq: * strio.each_byte {|byte| block } -> strio * * See IO#each_byte. */ static VALUE strio_each_byte(self) VALUE self; { struct StringIO *ptr = readable(StringIO(self)); while (ptr->pos < RSTRING(ptr->string)->len) { char c = RSTRING(ptr->string)->ptr[ptr->pos++]; rb_yield(CHR2FIX(c)); } return Qnil; }