-static VALUE cComments, eVTError, io_buf;
-static ID id_read, id_write, id_seek, id_length;
-
-static size_t
-on_read (void *ptr, size_t size, size_t nmemb, RbVorbisTagger *o)
-{
- struct RString *buf;
- size_t total = size * nmemb;
- VALUE tmp;
-
- rb_str_resize (io_buf, size * nmemb);
-
- tmp = rb_funcall (o->io, id_read, 2, LONG2NUM (total), io_buf);
- if (NIL_P (tmp))
- return 0;
-
- buf = RSTRING (tmp);
- memcpy (ptr, buf->ptr, buf->len);
-
- return buf->len;
-}
-
-static size_t
-on_write (const void *ptr, size_t size, size_t nmemb, RbVorbisTagger *o)
-{
- size_t total = size * nmemb;
-
- rb_str_resize (io_buf, total);
- memcpy (RSTRING (io_buf)->ptr, ptr, total);
-
- return NUM2LONG (rb_io_write (o->io, io_buf));
-}
-
-static void
-c_mark (RbVorbisTagger *o)
-{
- rb_gc_mark (o->io);
- rb_gc_mark (o->comments);
-}