summary refs log tree commit diff
path: root/tag.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tag.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/tag.c b/tag.c
index e9b098b..13e06f3 100644
--- a/tag.c
+++ b/tag.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018  Curtis McEnroe <june@causal.agency>
+/* Copyright (C) 2018  C. McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -21,20 +21,26 @@
 
 #include "chat.h"
 
-#define NONE   "-none-"
-#define STATUS "-status-"
-#define RAW    "-raw-"
+#define GLOBAL_TAGS \
+	X(TagNone,   0, "<none>") \
+	X(TagStatus, 1, "<status>") \
+	X(TagRaw,    2, "<raw>")
+enum { GlobalTagsLen = 3 };
 
-const struct Tag TagNone   = { 0, NONE };
-const struct Tag TagStatus = { 1, STATUS };
-const struct Tag TagRaw    = { 2, RAW };
+#define X(tag, id, name) const struct Tag tag = { id, name };
+GLOBAL_TAGS
+#undef X
 
 static struct {
 	char *name[TagsLen];
 	size_t len;
 } tags = {
-	.name = { NONE, STATUS, RAW },
-	.len = 3,
+	.name = {
+#define X(_, id, name) [id] = name,
+		GLOBAL_TAGS
+#undef X
+	},
+	.len = GlobalTagsLen,
 };
 
 struct Tag tagFind(const char *name) {
04-04Update "Care"June McEnroe 2022-04-03Publish "Care"June McEnroe 2022-03-31Publish "Compassion"June McEnroe 2022-03-24Skip matches with ident chars on either sideJune McEnroe This fixes, for example, where the link gets placed on static regex_t regex(const char *pattern, int flags) in title.c. 2022-03-24Add The Invisible Life of Addie LaRueJune McEnroe So good, but so long. Reminded me of The Ten Thousand Doors of January at the beginning, and more of that N. K. Jemisin series about gods later. I like this interacting with gods and becoming something like one sort of thing. God, it took me a whole month (more?) to read and this is only my third book of the year :( I need some more novellas to read, but the other books I have from the library currently are also thick. 2022-03-22Source ~/.profile.local if it existsJune McEnroe 2022-03-18Publish "Addendum 2021"June McEnroe 2022-03-16Remove wcwidth portJune McEnroe DYLD_FORCE_FLAT_NAMESPACE no longer exists in macOS 12 so this approach doesn't work anymore. Moved to <https://git.causal.agency/jorts/tree/wcwidth> and compiled into <https://git.causal.agency/jorts/tree/ncurses>. 2022-03-16Remove -j4 from ./PlanJune McEnroe Plan learned to set this automatically! 2022-03-15Rewrite Linux install.sh for DebianJune McEnroe 2022-03-15Remove dashJune McEnroe