+#elif HAVE_TC
+static int
+hcache_open_tc (struct header_cache* h, const char* path)
+{
+ h->db = tcbdbnew();
+ if (option(OPTHCACHECOMPRESS))
+ tcbdbtune(h->db, 0, 0, 0, -1, -1, BDBTDEFLATE);
+ if (tcbdbopen(h->db, path, BDBOWRITER | BDBOCREAT))
+ return 0;
+ else
+ {
+ tcbdbdel(h->db);
+ return -1;
+ }
+}
+
+void
+mutt_hcache_close(header_cache_t *h)
+{
+ if (!h)
+ return;
+
+ tcbdbclose(h->db);
+ tcbdbdel(h->db);
+ FREE(&h->folder);
+ FREE(&h);
+}
+
+int
+mutt_hcache_delete(header_cache_t *h, const char *filename,
+ size_t(*keylen) (const char *fn))
+{
+ char path[_POSIX_PATH_MAX];
+ int ksize;
+
+ if (!h)
+ return -1;
+
+ strncpy(path, h->folder, sizeof (path));
+ safe_strcat(path, sizeof (path), filename);
+
+ ksize = strlen(h->folder) + keylen(path + strlen(h->folder));
+
+ return tcbdbout(h->db, path, ksize);
+}
+