aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.h
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-10-20 09:56:25 -0700
committerGravatar Carl Worth <cworth@cworth.org>2009-10-20 09:58:40 -0700
commit55c8ee9a862f8f25be84adb591564b3777d88135 (patch)
treea59eb08ca8615a241c621404007f6d7a9f6c2cf2 /notmuch.h
parented6ee7330d28c65cb3990cbe4a5ac6182bf23402 (diff)
notmuch_database_create/open: Fix to handle NULL as documented.
When documenting these functions I described support for a NOTMUCH_BASE environment variable to be consulted in the case of a NULL path. Only, I had forgotten to actually write the code. This code exists now, with a new, exported function: notmuch_database_default_path
Diffstat (limited to 'notmuch.h')
-rw-r--r--notmuch.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/notmuch.h b/notmuch.h
index e0b57db2..b63a7d77 100644
--- a/notmuch.h
+++ b/notmuch.h
@@ -110,6 +110,23 @@ notmuch_database_open (const char *path);
void
notmuch_database_close (notmuch_database_t *database);
+/* Lookup the default database path.
+ *
+ * This is the path that will be used by notmuch_database_create and
+ * notmuch_database_open if given a NULL path. Specifically it will be
+ * the value of the NOTMUCH_BASE environment variable if set,
+ * otherwise ${HOME}/mail
+ *
+ * Returns a newly allocated string which the caller should free()
+ * when finished with it.
+ */
+char *
+notmuch_database_default_path (void);
+
+/* Return the database path of the given database.
+ *
+ * The return value is a string owned by notmuch so should not be
+ * modified nor freed by the caller. */
const char *
notmuch_database_get_path (notmuch_database_t *database);