Separated vcedit_state_new() and vcedit_open() again.
[ruby-vorbistagger.git] / ext / ext.c
index 0ee20d352d06b640c19734459684d3bf5f3a044f..9c433f285523c12196501363e132a8662f9907e5 100644 (file)
--- a/ext/ext.c
+++ b/ext/ext.c
@@ -103,6 +103,10 @@ c_init (VALUE self, VALUE filename)
                rb_raise (eVTError, "vcedit_new_state() failed - %s",
                          vcedit_error (o->state));
 
+       if (vcedit_open (o->state) < 0)
+               rb_raise (eVTError, "vcedit_open() failed - %s",
+                         vcedit_error (o->state));
+
        vc = vcedit_comments (o->state);
        if (!vc)
                rb_raise (eVTError, "vcedit_comments() failed - %s",
@@ -201,6 +205,7 @@ Init_vorbistagger_ext (void)
 
        rb_define_singleton_method (cVT, "open", c_open, 1);
        rb_define_method (cVT, "initialize", c_init, 1);
+       rb_define_method (cVT, "close", c_close, 0);
        rb_define_method (cVT, "write", c_write, 0);
        rb_define_method (cVT, "comments", c_comments, 0);