summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
Diffstat (limited to 'chat.h')
-rw-r--r--chat.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/chat.h b/chat.h
index cd8798c..89d5797 100644
--- a/chat.h
+++ b/chat.h
@@ -105,6 +105,15 @@ static inline size_t styleParse(struct Style *style, const char **str) {
 	return strcspn(*str, (const char[]) { B, C, O, R, I, U, '\0' });
 }
 
+static inline void styleStrip(struct Cat *cat, const char *str) {
+	struct Style style = StyleDefault;
+	while (*str) {
+		size_t len = styleParse(&style, &str);
+		catf(cat, "%.*s", (int)len, str);
+		str += len;
+	}
+}
+
 enum { None, Debug, Network, IDCap = 256 };
 extern char *idNames[IDCap];
 extern enum Color idColors[IDCap];
400'>2022-06-02Set TABSIZE=4June McEnroe Absolutely indiscriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe