diff options
author | Carl Worth <cworth@cworth.org> | 2009-10-20 21:03:30 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-10-20 21:21:39 -0700 |
commit | 466a7bbf620e4bf1b57097a6d3c474159c475b6d (patch) | |
tree | 178d6175c4a70d6d5d3e005c6b9ec6464b99c1c9 /database.cc | |
parent | cd4a8734d3bb151df70d51a84903bff994439b05 (diff) |
Implement 'notmuch dump'.
This is a fairly big milestone for notmuch. It's our first command
to do anything besides building the index, so it proves we can
actually read valid results out from the index.
It also puts in place almost all of the API and infrastructure we
will need to allow searching of the database.
Finally, with this change we are now using talloc inside of notmuch
which is truly a delight to use. And now that I figured out how
to use C++ objects with talloc allocation, (it requires grotty
parts of C++ such as "placement new" and "explicit destructors"),
we are valgrind-clean for "notmuch dump", (as in "no leaks are
possible").
Diffstat (limited to 'database.cc')
-rw-r--r-- | database.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/database.cc b/database.cc index 7e678d8..041cffd 100644 --- a/database.cc +++ b/database.cc @@ -18,7 +18,7 @@ * Author: Carl Worth <cworth@cworth.org> */ -#include "notmuch-private.h" +#include "database-private.h" #include <iostream> @@ -28,12 +28,6 @@ using namespace std; -struct _notmuch_database { - char *path; - Xapian::WritableDatabase *xapian_db; - Xapian::TermGenerator *term_gen; -}; - #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0])) /* Xapian complains if we provide a term longer than this. */ @@ -463,6 +457,7 @@ notmuch_database_open (const char *path) notmuch->path = xstrdup (path); try { + Xapian::PostingIterator i; notmuch->xapian_db = new Xapian::WritableDatabase (xapian_path, Xapian::DB_CREATE_OR_OPEN); } catch (const Xapian::Error &error) { |