From c0be6fe4b207fe8f57e8a9a97734302b15733831 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sat, 30 Jul 2022 17:51:58 -0400 Subject: "Rename" complete to cache, refactor interfaces --- chat.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'chat.h') diff --git a/chat.h b/chat.h index eecb7d9..b7de9ac 100644 --- a/chat.h +++ b/chat.h @@ -396,6 +396,22 @@ int bufferReflow( struct Buffer *buffer, int cols, enum Heat thresh, size_t tail ); +struct Cursor { + uint gen; + struct Node *node; +}; +void cacheInsert(bool touch, uint id, const char *key); +void cacheInsertColor(bool touch, uint id, const char *key, enum Color color); +void cacheReplace(bool touch, const char *old, const char *new); +enum Color cacheColor(uint id, const char *key); +const char *cachePrefix(struct Cursor *curs, uint id, const char *prefix); +const char *cacheSubstr(struct Cursor *curs, uint id, const char *substr); +uint cacheID(struct Cursor *curs, const char *key); +void cacheAccept(struct Cursor *curs); +void cacheReject(struct Cursor *curs); +void cacheRemove(uint id, const char *key); +void cacheClear(uint id); + const char *complete(uint id, const char *prefix); const char *completeSubstr(uint id, const char *substr); void completeAccept(void); -- cgit 1.4.1