From c2317921f8429d0f2f0e7579beabf4dd9e987247 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 22 Feb 2019 14:32:00 -0500 Subject: Rename global tags with angle brackets --- catgirl.1 | 4 ++-- tag.c | 24 +++++++++++++++--------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/catgirl.1 b/catgirl.1 index 88f1945..5be44ec 100644 --- a/catgirl.1 +++ b/catgirl.1 @@ -88,7 +88,7 @@ the same as the nickname. . .It Fl v Show raw IRC protocol in the -.Sy -raw- +.Sy window. . .It Fl w Ar pass @@ -181,7 +181,7 @@ matching the . .It Ic /raw Toggle the -.Sy -raw- +.Sy window. . .It Ic /url 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 +/* Copyright (C) 2018 C. McEnroe * * 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, "") \ + X(TagStatus, 1, "") \ + X(TagRaw, 2, "") +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) { -- cgit 1.4.1 'txt' type='search' size='10' name='q' value=''/>
Commit message (Expand)Author
2022-06-25Bump xterm font size to 12June McEnroe
2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe
2022-06-10Switch to jorts Install scriptJune McEnroe
2022-06-08Indicate if still reading or no resultsJune McEnroe
2022-06-08Add Maiden, Mother, CroneJune McEnroe
2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe
2022-06-03Set line number on File linesJune McEnroe
2022-06-03Stop polling stdin after EOFJune McEnroe
2022-06-02Set TABSIZE=4June McEnroe
2022-06-02Do basic match highlightingJune McEnroe
2022-06-02Clean up parsing a littleJune McEnroe
2022-06-02Don't duplicate path stringJune McEnroe
2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe
2022-06-02Add initial working version of qfJune McEnroe
2022-05-29Set prompt for okshJune McEnroe