X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fruby%2Fdatabase.c;fp=bindings%2Fruby%2Fdatabase.c;h=a4659ca3737a712f77f50fba55cb43ac05cb33c5;hp=f4edd77303afb2be7ed64b22d49b789cd43b1472;hb=bbb41081d797c3301e4d202e30c4111207fe7693;hpb=a08aa32b44b28f50f00cbd69e1a39023158f1847 diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index f4edd773..a4659ca3 100644 --- a/bindings/ruby/database.c +++ b/bindings/ruby/database.c @@ -1,6 +1,6 @@ /* The Ruby interface to the notmuch mail library * - * Copyright © 2010 Ali Polatel + * Copyright © 2010, 2011 Ali Polatel * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -204,6 +204,44 @@ notmuch_rb_database_upgrade(VALUE self) return Qtrue; } +/* + * call-seq: DB.begin_atomic => nil + * + * Begin an atomic database operation. + */ +VALUE +notmuch_rb_database_begin_atomic(VALUE self) +{ + notmuch_status_t ret; + notmuch_database_t *db; + + Data_Get_Notmuch_Database(self, db); + + ret = notmuch_database_begin_atomic(db); + notmuch_rb_status_raise(ret); + + return Qtrue; +} + +/* + * call-seq: DB.end_atomic => nil + * + * Indicate the end of an atomic database operation. + */ +VALUE +notmuch_rb_database_end_atomic(VALUE self) +{ + notmuch_status_t ret; + notmuch_database_t *db; + + Data_Get_Notmuch_Database(self, db); + + ret = notmuch_database_end_atomic(db); + notmuch_rb_status_raise(ret); + + return Qtrue; +} + /* * call-seq: DB.get_directory(path) => DIR *