mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
ruby: Update Ruby bindings for new notmuch_database_{open, create} signatures
This commit is contained in:
parent
0a357fe410
commit
9721343e5b
1 changed files with 9 additions and 3 deletions
|
@ -42,6 +42,8 @@ notmuch_rb_database_initialize (int argc, VALUE *argv, VALUE self)
|
||||||
int create, mode;
|
int create, mode;
|
||||||
VALUE pathv, hashv;
|
VALUE pathv, hashv;
|
||||||
VALUE modev;
|
VALUE modev;
|
||||||
|
notmuch_database_t *database;
|
||||||
|
notmuch_status_t ret;
|
||||||
|
|
||||||
/* Check arguments */
|
/* Check arguments */
|
||||||
rb_scan_args (argc, argv, "11", &pathv, &hashv);
|
rb_scan_args (argc, argv, "11", &pathv, &hashv);
|
||||||
|
@ -73,9 +75,13 @@ notmuch_rb_database_initialize (int argc, VALUE *argv, VALUE self)
|
||||||
}
|
}
|
||||||
|
|
||||||
Check_Type (self, T_DATA);
|
Check_Type (self, T_DATA);
|
||||||
DATA_PTR (self) = create ? notmuch_database_create (path) : notmuch_database_open (path, mode);
|
if (create)
|
||||||
if (!DATA_PTR (self))
|
ret = notmuch_database_create (path, &database);
|
||||||
rb_raise (notmuch_rb_eDatabaseError, "Failed to open database");
|
else
|
||||||
|
ret = notmuch_database_open (path, mode, &database);
|
||||||
|
notmuch_rb_status_raise (ret);
|
||||||
|
|
||||||
|
DATA_PTR (self) = database;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue