From: Ken Hornstein Date: Thu, 10 Jan 2013 19:18:15 +0000 (-0500) Subject: Convert the MIME content cache switches over to the smatch() New World Order. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/25211cc6081e2075ecaf0565733075285a135411?hp=-c Convert the MIME content cache switches over to the smatch() New World Order. --- 25211cc6081e2075ecaf0565733075285a135411 diff --git a/h/mhcachesbr.h b/h/mhcachesbr.h index 2ef2c6da..8f980a60 100644 --- a/h/mhcachesbr.h +++ b/h/mhcachesbr.h @@ -6,14 +6,17 @@ /* * various cache policies */ -static struct swit caches[] = { -#define CACHE_NEVER 0 - { "never", 0, 0 }, -#define CACHE_PRIVATE 1 - { "private", 0, 0 }, -#define CACHE_PUBLIC 2 - { "public", 0, 0 }, -#define CACHE_ASK 3 - { "ask", 0, 0 }, - { NULL, 0, 0 } -}; + +#define CACHE_SWITCHES \ + X("never", 0, CACHE_NEVER) \ + X("private", 0, CACHE_PRIVATE) \ + X("public", 0, CACHE_PUBLIC) \ + X("ask", 0, CACHE_ASK) \ + +#define X(sw, minchars, id) id, +DEFINE_SWITCH_ENUM(CACHE); +#undef X + +#define X(sw, minchars, id) { sw, minchars, id }, +DEFINE_SWITCH_ARRAY(CACHE, caches); +#undef X