X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bindings%2Fruby%2Ftags.c;h=955d790f3bb79e7e0a100aec758fdf9d2b443a8b;hb=3a52290609b07b51b16b527d1c14ac9836760300;hp=2af85e36598220f1cb93e806a8080ed2c3a3b862;hpb=d21e72c9f95d1d052360976302a2f9cfcc1556a5;p=notmuch diff --git a/bindings/ruby/tags.c b/bindings/ruby/tags.c index 2af85e36..955d790f 100644 --- a/bindings/ruby/tags.c +++ b/bindings/ruby/tags.c @@ -20,6 +20,18 @@ #include "defs.h" +VALUE +notmuch_rb_tags_get (notmuch_tags_t *tags) +{ + VALUE rb_array = rb_ary_new (); + + for (; notmuch_tags_valid (tags); notmuch_tags_move_to_next (tags)) { + const char *tag = notmuch_tags_get (tags); + rb_ary_push (rb_array, rb_str_new2 (tag)); + } + return rb_array; +} + /* * call-seq: TAGS.destroy! => nil *