about summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2023-02-05 14:35:40 -0500
committerJune McEnroe <june@causal.agency>2023-02-05 19:28:36 -0500
commit06be4c5956248021192e549d05aea066b5d2f13b (patch)
tree43accf040a26199bf42fb1fcbd48ea91df41a8d8 /chat.h
parentFlatten cache structs (diff)
downloadcatgirl-06be4c5956248021192e549d05aea066b5d2f13b.tar.gz
catgirl-06be4c5956248021192e549d05aea066b5d2f13b.zip
Fix what went wrong, part 1
Diffstat (limited to 'chat.h')
-rw-r--r--chat.h33
1 files changed, 12 insertions, 21 deletions
diff --git a/chat.h b/chat.h
index 8086c9e..6a3f669 100644
--- a/chat.h
+++ b/chat.h
@@ -304,7 +304,7 @@ const char *commandIsPrivmsg(uint id, const char *input);
 const char *commandIsNotice(uint id, const char *input);
 const char *commandIsAction(uint id, const char *input);
 size_t commandWillSplit(uint id, const char *input);
-void commandCache(void);
+void commandCompletion(void);
 
 enum Heat {
 	Ice,
@@ -346,7 +346,7 @@ void inputWait(void);
 void inputUpdate(void);
 bool inputPending(uint id);
 void inputRead(void);
-void inputCache(void);
+void inputCompletion(void);
 int inputSave(FILE *file);
 void inputLoad(FILE *file, size_t version);
 
@@ -408,28 +408,19 @@ int bufferReflow(
 	struct Buffer *buffer, int cols, enum Heat thresh, size_t tail
 );
 
-struct Entry {
-	uint id;
-	char *key;
-	enum Color color;
-	uint prefixBits;
-	struct Entry *prev;
-	struct Entry *next;
-};
 struct Cursor {
 	uint gen;
-	struct Entry *entry;
+	struct Node *node;
 };
-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 cacheNextID(struct Cursor *curs, const char *key);
-const char *cacheNextKey(struct Cursor *curs, uint id);
-void cacheTouch(struct Cursor *curs);
+void completePush(uint id, const char *str);
+void completePull(uint id, const char *str);
+void completeReplace(const char *old, const char *new);
+void completeRemove(uint id, const char *str);
+const char *completePrefix(struct Cursor *curs, uint id, const char *prefix);
+const char *completeSubstr(struct Cursor *curs, uint id, const char *substr);
+uint completeNextID(struct Cursor *curs, const char *str);
+void completeAccept(struct Cursor *curs);
+void completeReject(struct Cursor *curs);
 
 extern struct Util urlOpenUtil;
 extern struct Util urlCopyUtil;