projects
/
notmuch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0a357fe
)
ruby: Update Ruby bindings for new notmuch_database_{open, create} signatures
author
Austin Clements
<amdragon@MIT.EDU>
Mon, 30 Apr 2012 16:25:37 +0000
(12:25 -0400)
committer
David Bremner
<bremner@debian.org>
Sat, 5 May 2012 13:14:47 +0000
(10:14 -0300)
bindings/ruby/database.c
patch
|
blob
|
history
diff --git
a/bindings/ruby/database.c
b/bindings/ruby/database.c
index ba9a1391a50918f25ca2d1bc5921c4907666e11b..409d54fa504e85e8f88037cf7b99f4dcdbf2eb89 100644
(file)
--- a/
bindings/ruby/database.c
+++ b/
bindings/ruby/database.c
@@
-42,6
+42,8
@@
notmuch_rb_database_initialize (int argc, VALUE *argv, VALUE self)
int create, mode;
VALUE pathv, hashv;
VALUE modev;
int create, mode;
VALUE pathv, hashv;
VALUE modev;
+ notmuch_database_t *database;
+ notmuch_status_t ret;
/* Check arguments */
rb_scan_args (argc, argv, "11", &pathv, &hashv);
/* Check arguments */
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 (!DATA_PTR (self))
- rb_raise (notmuch_rb_eDatabaseError, "Failed to open database");
+ if (create)
+ ret = notmuch_database_create (path, &database);
+ else
+ ret = notmuch_database_open (path, mode, &database);
+ notmuch_rb_status_raise (ret);
+
+ DATA_PTR (self) = database;
return self;
}
return self;
}