ruby: add filenames helper

Right now it doesn't do much, but it will help for further
reorganization.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras 2023-03-27 15:59:40 -06:00 committed by David Bremner
parent a554690d6a
commit 777b02a7d7
4 changed files with 12 additions and 3 deletions

View file

@ -224,6 +224,9 @@ VALUE
notmuch_rb_directory_get_child_directories (VALUE self); notmuch_rb_directory_get_child_directories (VALUE self);
/* filenames.c */ /* filenames.c */
VALUE
notmuch_rb_filenames_get (notmuch_filenames_t *fnames);
VALUE VALUE
notmuch_rb_filenames_destroy (VALUE self); notmuch_rb_filenames_destroy (VALUE self);

View file

@ -87,7 +87,7 @@ notmuch_rb_directory_get_child_files (VALUE self)
fnames = notmuch_directory_get_child_files (dir); fnames = notmuch_directory_get_child_files (dir);
return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, &notmuch_rb_filenames_type, fnames); return notmuch_rb_filenames_get (fnames);
} }
/* /*
@ -106,5 +106,5 @@ notmuch_rb_directory_get_child_directories (VALUE self)
fnames = notmuch_directory_get_child_directories (dir); fnames = notmuch_directory_get_child_directories (dir);
return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, &notmuch_rb_filenames_type, fnames); return notmuch_rb_filenames_get (fnames);
} }

View file

@ -20,6 +20,12 @@
#include "defs.h" #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 * call-seq: FILENAMES.destroy! => nil
* *

View file

@ -120,7 +120,7 @@ notmuch_rb_message_get_filenames (VALUE self)
fnames = notmuch_message_get_filenames (message); fnames = notmuch_message_get_filenames (message);
return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, &notmuch_rb_filenames_type, fnames); return notmuch_rb_filenames_get (fnames);
} }
/* /*