Commit Diff


commit - eb4388ee431fd55a5d1a9831935fb2eb77f46be9
commit + 3768e50f4730c0d2af1c97de6ee1c0f2677cb42e
blob - ddba9d64c485f3f5ea1b1fcd4dc321eea2624c41
blob + 7829dd7f866afdc5f93a6096c0baa5eb5343e1c8
--- fs.c
+++ fs.c
@@ -316,7 +316,7 @@ load_certs(struct ohash *h)
 			abort();
 
 		if (i != 0)
-			telescope_ohash_insert(h, e);
+			tofu_add(h, e);
 	}
 
 	free(line);
blob - 493503f978fc585e875d1ac84a289b1cac1d527c
blob + 1814b4ea5d3302c0cbd2f818d003bc8c72d64710
--- hash.c
+++ hash.c
@@ -46,7 +46,7 @@ hash_free(void *ptr, void *d)
 }
 
 void
-telescope_ohash_init(struct ohash *h, unsigned int sz, ptrdiff_t ko)
+tofu_init(struct ohash *h, unsigned int sz, ptrdiff_t ko)
 {
 	struct ohash_info info = {
 		.key_offset = ko,
@@ -59,7 +59,7 @@ telescope_ohash_init(struct ohash *h, unsigned int sz,
 }
 
 struct tofu_entry *
-telescope_lookup_tofu(struct ohash *h, const char *domain, const char *port)
+tofu_lookup(struct ohash *h, const char *domain, const char *port)
 {
 	char		buf[GEMINI_URL_LEN];
 	unsigned int	slot;
@@ -75,7 +75,7 @@ telescope_lookup_tofu(struct ohash *h, const char *dom
 }
 
 void
-telescope_ohash_insert(struct ohash *h, struct tofu_entry *e)
+tofu_add(struct ohash *h, struct tofu_entry *e)
 {
 	unsigned int	slot;
 
blob - e251634d6a37fb0eff87424768dbafd912f746b6
blob + 1dc54d50a6a4ae71a414eb217d9d8799d0b34fde
--- telescope.c
+++ telescope.c
@@ -100,7 +100,7 @@ handle_imsg_check_cert(struct imsg *imsg, size_t datal
 
 	tab = tab_by_id(imsg->hdr.peerid);
 
-	if ((e = telescope_lookup_tofu(&certs, tab->uri.host, tab->uri.port)) == NULL) {
+	if ((e = tofu_lookup(&certs, tab->uri.host, tab->uri.port)) == NULL) {
 		/* TODO: an update in libressl/libretls changed
 		 * significantly.  Find a better approach at storing
 		 * the certs! */
@@ -116,7 +116,7 @@ handle_imsg_check_cert(struct imsg *imsg, size_t datal
 			strlcat(e->domain, tab->uri.port, sizeof(e->domain));
 		}
 		strlcpy(e->hash, hash, sizeof(e->hash));
-		telescope_ohash_insert(&certs, e);
+		tofu_add(&certs, e);
 		imsg_compose(fsibuf, IMSG_SAVE_CERT, tab->id, 0, -1,
 		    e, sizeof(*e));
 		imsg_flush(fsibuf);
@@ -484,7 +484,7 @@ main(int argc, char * const *argv)
 
 	setproctitle("ui");
 
-	telescope_ohash_init(&certs, 5, offsetof(struct tofu_entry, domain));
+	tofu_init(&certs, 5, offsetof(struct tofu_entry, domain));
 	load_certs(&certs);
 
 	TAILQ_INIT(&tabshead);
blob - fe940e5a5b5676539699936256b935d90222e28b
blob + 87197992d46f7e14a98023462a0f530f600c2aa8
--- telescope.h
+++ telescope.h
@@ -202,9 +202,9 @@ int		 client_main(struct imsgbuf*);
 void		 gemtext_initparser(struct parser*);
 
 /* hash.c */
-void			 telescope_ohash_init(struct ohash*, unsigned int, ptrdiff_t);
-struct tofu_entry	*telescope_lookup_tofu(struct ohash*, const char*, const char*);
-void			 telescope_ohash_insert(struct ohash*, struct tofu_entry*);
+void			 tofu_init(struct ohash*, unsigned int, ptrdiff_t);
+struct tofu_entry	*tofu_lookup(struct ohash*, const char*, const char*);
+void			 tofu_add(struct ohash*, struct tofu_entry*);
 
 /* hist.c */
 void		 hist_clear_forward(struct histhead*, struct hist*);