/* Create filename corresponding to DAV DB for mailbox */ EXPORTED void dav_getpath(struct buf *fname, struct mailbox *mailbox) { const char *userid; userid = mboxname_to_userid(mailbox->name); if (userid) dav_getpath_byuserid(fname, userid); else buf_setcstr(fname, mailbox_meta_fname(mailbox, META_DAV)); }
EXPORTED sqldb_t *dav_open_userid(const char *userid) { sqldb_t *db = NULL; struct buf fname = BUF_INITIALIZER; dav_getpath_byuserid(&fname, userid); if (in_reconstruct) buf_printf(&fname, ".NEW"); db = sqldb_open(buf_cstring(&fname), CMD_CREATE, DB_VERSION, davdb_upgrade); buf_free(&fname); return db; }