about summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-25 23:10:40 -0500
committerJune McEnroe <june@causal.agency>2019-02-25 23:10:40 -0500
commit4cda410b574c93c2ea7ad467e2b27809d0a0ba62 (patch)
treeaaffc0e9b1379f1a9fb7fa571b2807077d4acbbe /chat.h
parentAdd M-l to list the log (diff)
downloadcatgirl-4cda410b574c93c2ea7ad467e2b27809d0a0ba62.tar.gz
catgirl-4cda410b574c93c2ea7ad467e2b27809d0a0ba62.zip
Move nick and tag coloring to color.c
Diffstat (limited to 'chat.h')
-rw-r--r--chat.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/chat.h b/chat.h
index d6c234c..6f08a01 100644
--- a/chat.h
+++ b/chat.h
@@ -52,6 +52,18 @@ void eventWait(const char *argv[static 2]);
 void eventPipe(const char *argv[static 2]);
 noreturn void eventLoop(void);
 
+struct Tag {
+	size_t id;
+	const char *name;
+};
+
+enum { TagsLen = 256 };
+const struct Tag TagNone;
+const struct Tag TagStatus;
+const struct Tag TagRaw;
+struct Tag tagFind(const char *name);
+struct Tag tagFor(const char *name);
+
 enum IRCColor {
 	IRCWhite,
 	IRCBlack,
@@ -80,19 +92,6 @@ enum {
 	IRCUnderline = 037,
 };
 
-struct Tag {
-	size_t id;
-	const char *name;
-	enum IRCColor color;
-};
-
-enum { TagsLen = 256 };
-const struct Tag TagNone;
-const struct Tag TagStatus;
-const struct Tag TagRaw;
-struct Tag tagFind(const char *name);
-struct Tag tagFor(const char *name, enum IRCColor color);
-
 struct Format {
 	const wchar_t *str;
 	size_t len;
@@ -102,7 +101,10 @@ struct Format {
 };
 void formatReset(struct Format *format);
 bool formatParse(struct Format *format, const wchar_t *split);
-enum IRCColor formatColor(const char *str);
+
+enum IRCColor colorGen(const char *str);
+struct Tag colorTag(struct Tag tag, const char *gen);
+enum IRCColor colorFor(struct Tag tag);
 
 void handle(char *line);
 void input(struct Tag tag, char *line);