about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-30 22:09:36 -0500
committerJune McEnroe <june@causal.agency>2019-12-30 22:09:36 -0500
commita498022793aa559a1739bd99189ade74b15e077f (patch)
tree75963abc5feca9dc5cfb8d6f3877c89b970808f6
parentRemove scoop -ABC (diff)
downloadlitterbox-a498022793aa559a1739bd99189ade74b15e077f.tar.gz
litterbox-a498022793aa559a1739bd99189ade74b15e077f.zip
Use X macro for Type enum
Diffstat (limited to '')
-rw-r--r--database.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/database.h b/database.h
index 0494851..1837a9f 100644
--- a/database.h
+++ b/database.h
@@ -32,16 +32,21 @@
 
 enum { DatabaseVersion = 0 };
 
+#define ENUM_TYPE \
+	X(Privmsg, "privmsg") \
+	X(Notice, "notice") \
+	X(Action, "action") \
+	X(Join, "join") \
+	X(Part, "part") \
+	X(Quit, "quit") \
+	X(Kick, "kick") \
+	X(Nick, "nick") \
+	X(Topic, "topic")
+
 enum Type {
-	Privmsg,
-	Notice,
-	Action,
-	Join,
-	Part,
-	Quit,
-	Kick,
-	Nick,
-	Topic,
+#define X(id, _) id,
+	ENUM_TYPE
+#undef X
 };
 
 static bool verbose;