From 4cda410b574c93c2ea7ad467e2b27809d0a0ba62 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 25 Feb 2019 23:10:40 -0500 Subject: Move nick and tag coloring to color.c --- chat.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'chat.h') 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); -- cgit 1.4.1-2-gfad0