From 519fcc436fb5d432c6dbc971c2afb40203abe422 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 30 Dec 2020 16:49:55 -0500 Subject: Factor out reply count checking and decrementing --- chat.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'chat.h') diff --git a/chat.h b/chat.h index e1f6584..c7af680 100644 --- a/chat.h +++ b/chat.h @@ -247,21 +247,24 @@ static inline void utilPush(struct Util *util, const char *arg) { } } -extern struct Replies { - uint away; - uint ban; - uint excepts; - uint help; - uint invex; - uint join; - uint list; - uint mode; - uint names; - uint topic; - uint who; - uint whois; - uint whowas; -} replies; +enum Reply { + ReplyAway = 1, + ReplyBan, + ReplyExcepts, + ReplyHelp, + ReplyInvex, + ReplyJoin, + ReplyList, + ReplyMode, + ReplyNames, + ReplyTopic, + ReplyWho, + ReplyWhois, + ReplyWhowas, + ReplyCap, +}; + +extern uint replies[ReplyCap]; void handle(struct Message *msg); void command(uint id, char *input); -- cgit 1.4.0