summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-05 00:20:39 -0500
committerJune McEnroe <june@causal.agency>2020-02-05 00:20:39 -0500
commit4cce893eab7403821ff211f64a7df05051fd6f52 (patch)
tree3499aa89f3a5b59356abcc9c215babe057bff4a4 /chat.h
parentConvert editHead and editTail from wchar_t (diff)
downloadcatgirl-4cce893eab7403821ff211f64a7df05051fd6f52.tar.gz
catgirl-4cce893eab7403821ff211f64a7df05051fd6f52.zip
Add extremely basic editing and message sending
Diffstat (limited to 'chat.h')
-rw-r--r--chat.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/chat.h b/chat.h
index c754357..c8b31c2 100644
--- a/chat.h
+++ b/chat.h
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <sysexits.h>
 #include <time.h>
+#include <wchar.h>
 
 #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
 #define BIT(x) x##Bit, x = 1 << x##Bit, x##Bit_ = x##Bit
@@ -109,6 +110,7 @@ void ircFormat(const char *format, ...)
 	__attribute__((format(printf, 1, 2)));
 
 void handle(struct Message msg);
+void command(size_t id, char *input);
 
 enum Heat { Cold, Warm, Hot };
 void uiInit(void);
@@ -122,8 +124,14 @@ void uiFormat(
 	size_t id, enum Heat heat, const time_t *time, const char *format, ...
 ) __attribute__((format(printf, 4, 5)));
 
-const char *editHead(void);
-const char *editTail(void);
+enum Edit {
+	EditKill,
+	EditInsert,
+	EditEnter,
+};
+void edit(size_t id, enum Edit op, wchar_t ch);
+char *editHead(void);
+char *editTail(void);
 
 static inline enum Color hash(const char *str) {
 	if (*str == '~') str++;
r.c?h=backport&id=306b27986ce6b51499d7db83009f51093a516901&follow=1'>Handle large movesJune McEnroe 2017-07-30Optimize builds for chrootJune McEnroe 2017-07-30Persist bright across color changesJune McEnroe 2017-07-30Add index.htmlJune McEnroe 2017-07-30Add snapshot.shJune McEnroe 2017-07-30Fix termcap patch for background colorsJune McEnroe 2017-07-30Update helpJune McEnroe 2017-07-30Fix help to track colorJune McEnroe 2017-07-30Support background colorsJune McEnroe 2017-07-30Track color only client-sideJune McEnroe 2017-07-30Add ostensible support for background colorsJune McEnroe 2017-07-30Add tile create and access timestampsJune McEnroe 2017-07-30Assert stable struct Tile field offsetsJune McEnroe 2017-07-30Add chroot.shJune McEnroe 2017-07-30Add ` commandJune McEnroe 2017-07-30Add sshd_configJune McEnroe 2017-07-30Add termcap patchJune McEnroe