]> git.cworth.org Git - notmuch/blobdiff - bindings/ruby/filenames.c
ruby: add filenames helper
[notmuch] / bindings / ruby / filenames.c
index 656c58e6f40dfdc87bcbc86b6dd7b2eb2680ecab..1787339359c41519be65332e632cf78669b1e10b 100644 (file)
 
 #include "defs.h"
 
+VALUE
+notmuch_rb_filenames_get (notmuch_filenames_t *fnames)
+{
+    return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, &notmuch_rb_filenames_type, fnames);
+}
+
 /*
  * call-seq: FILENAMES.destroy! => nil
  *
 VALUE
 notmuch_rb_filenames_destroy (VALUE self)
 {
-    notmuch_filenames_t *fnames;
-
-    Data_Get_Notmuch_FileNames (self, fnames);
-
-    notmuch_filenames_destroy (fnames);
-    DATA_PTR (self) = NULL;
+    notmuch_rb_object_destroy (self, &notmuch_rb_filenames_type);
 
     return Qnil;
 }