summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe2022-09-11 17:28:19 -0400
committerJune McEnroe2022-09-11 17:28:19 -0400
commitd043bad63ded27b71bf2762f6c07ca1186058cf2 (patch)
tree3d1383a083e13a18d5b305bacfd41cc75aa592c6 /chat.h
parentb5bd702c3cb9eab341bfca312b0a5cad3f5368be (diff)
Set pointer to Entry in Cursor
This feels a little redundant but the API makes sense, I think?
Diffstat (limited to 'chat.h')
-rw-r--r--chat.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/chat.h b/chat.h
index 628d416..c7053c7 100644
--- a/chat.h
+++ b/chat.h
@@ -403,17 +403,19 @@ struct Entry {
 struct Cursor {
 	uint gen;
 	struct Node *node;
+	struct Entry *entry;
 };
-struct Entry *cacheInsert(bool touch, uint id, const char *key);
 const struct Entry *cacheGet(uint id, const char *key);
+struct Entry *cacheInsert(bool touch, uint id, const char *key);
 void cacheReplace(bool touch, const char *old, const char *new);
+void cacheRemove(uint id, const char *key);
+void cacheClear(uint id);
 const char *cacheComplete(struct Cursor *curs, uint id, const char *prefix);
 const char *cacheSearch(struct Cursor *curs, uint id, const char *substr);
-uint cacheID(struct Cursor *curs, const char *key);
+uint cacheNextID(struct Cursor *curs, const char *key);
+const char *cacheNextKey(struct Cursor *curs, uint id);
 void cacheAccept(struct Cursor *curs);
 void cacheReject(struct Cursor *curs);
-void cacheRemove(uint id, const char *key);
-void cacheClear(uint id);
 
 extern struct Util urlOpenUtil;
 extern struct Util urlCopyUtil;