/*
* 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));
RETURN_ENUMERATOR(self, 0, 0);
while (ptr->pos < RSTRING_LEN(ptr->string)) {
char c = RSTRING_PTR(ptr->string)[ptr->pos++];
rb_yield(CHR2FIX(c));
}
return self;
}