From d043bad63ded27b71bf2762f6c07ca1186058cf2 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sun, 11 Sep 2022 17:28:19 -0400 Subject: Set pointer to Entry in Cursor This feels a little redundant but the API makes sense, I think? --- chat.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'chat.h') 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; -- cgit 1.4.1