- if (slash == path)
- parent_path = talloc_strdup (notmuch, "");
- else
- parent_path = talloc_strndup (notmuch, path, slash - path + 1);
+ if (slash == path) {
+ if (directory)
+ *directory = talloc_strdup (ctx, "");
+ if (basename)
+ *basename = path;
+ } else {
+ if (directory)
+ *directory = talloc_strndup (ctx, path, slash - path + 1);
+ }
+
+ return NOTMUCH_STATUS_SUCCESS;
+}
+
+notmuch_status_t
+_notmuch_database_find_directory_id (notmuch_database_t *notmuch,
+ const char *path,
+ unsigned int *directory_id)
+{
+ notmuch_private_status_t private_status;
+ notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;
+ const char *db_path;
+
+ if (path == NULL) {
+ *directory_id = 0;
+ return NOTMUCH_STATUS_SUCCESS;
+ }