diff options
author | June McEnroe <june@causal.agency> | 2020-02-05 00:20:39 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-02-05 00:20:39 -0500 |
commit | 4cce893eab7403821ff211f64a7df05051fd6f52 (patch) | |
tree | 3499aa89f3a5b59356abcc9c215babe057bff4a4 /chat.h | |
parent | Convert editHead and editTail from wchar_t (diff) | |
download | catgirl-4cce893eab7403821ff211f64a7df05051fd6f52.tar.gz catgirl-4cce893eab7403821ff211f64a7df05051fd6f52.zip |
Add extremely basic editing and message sending
Diffstat (limited to 'chat.h')
-rw-r--r-- | chat.h | 12 |
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++; |