about summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-07-30 17:51:58 -0400
committerJune McEnroe <june@causal.agency>2022-07-30 17:51:58 -0400
commitc0be6fe4b207fe8f57e8a9a97734302b15733831 (patch)
tree70e15a8811267037da8f8381e8eb9e5f27337819 /chat.h
parentShow STATUSMSG prefix (diff)
downloadcatgirl-c0be6fe4b207fe8f57e8a9a97734302b15733831.tar.gz
catgirl-c0be6fe4b207fe8f57e8a9a97734302b15733831.zip
"Rename" complete to cache, refactor interfaces
Diffstat (limited to '')
-rw-r--r--chat.h16
1 files changed, 16 insertions, 0 deletions
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);