diff options
author | June McEnroe <june@causal.agency> | 2020-04-10 14:49:26 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-04-10 14:49:26 -0400 |
commit | 74125df122a82574b751fefaffe6d76982527a80 (patch) | |
tree | 539c73707327d7b12b03288f6cfd9e09ce4810e7 | |
parent | Use dataCheck in parsing (diff) | |
download | bubger-74125df122a82574b751fefaffe6d76982527a80.tar.gz bubger-74125df122a82574b751fefaffe6d76982527a80.zip |
Move extra atoms into the predefined enum
Diffstat (limited to '')
-rw-r--r-- | archive.c | 2 | ||||
-rw-r--r-- | export.c | 12 | ||||
-rw-r--r-- | imap.h | 6 |
3 files changed, 6 insertions, 14 deletions
diff --git a/archive.c b/archive.c index 3b7d003..93f8355 100644 --- a/archive.c +++ b/archive.c @@ -103,8 +103,6 @@ int main(int argc, char *argv[]) { if (!pass) errx(EX_CONFIG, ENV_PASSWORD " unset"); } - enum Atom AtomThread = atom("THREAD"); - enum { Ready, Login, diff --git a/export.c b/export.c index 6e4c7fd..6e3554c 100644 --- a/export.c +++ b/export.c @@ -162,19 +162,7 @@ static struct Envelope parseEnvelope(struct List list) { return envelope; } -static enum Atom AtomBody; -static enum Atom AtomEnvelope; -static enum Atom AtomHeaderFields; -static enum Atom AtomText; -static enum Atom AtomUID; - void exportData(struct List items) { - if (!AtomBody) AtomBody = atom("BODY"); - if (!AtomEnvelope) AtomEnvelope = atom("ENVELOPE"); - if (!AtomHeaderFields) AtomHeaderFields = atom("HEADER.FIELDS"); - if (!AtomText) AtomText = atom("TEXT"); - if (!AtomUID) AtomUID = atom("UID"); - uint32_t uid = 0; struct Envelope envelope = {0}; char *header = NULL; diff --git a/imap.h b/imap.h index a7b4b64..f3ca668 100644 --- a/imap.h +++ b/imap.h @@ -52,6 +52,12 @@ X(AtomRecent, "RECENT") \ X(AtomExpunge, "EXPUNGE") \ X(AtomFetch, "FETCH") \ + X(AtomThread, "THREAD") \ + X(AtomUID, "UID") \ + X(AtomEnvelope, "ENVELOPE") \ + X(AtomBody, "BODY") \ + X(AtomHeaderFields, "HEADER.FIELDS") \ + X(AtomText, "TEXT") \ X(AtomUntagged, "*") enum Atom { |