about summary refs log tree commit diff
path: root/imap.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-14 13:40:54 -0400
committerJune McEnroe <june@causal.agency>2020-04-14 13:40:54 -0400
commita4ed715f7237b99aee25288af07f472882eba24c (patch)
tree5974ceb84d001161f22639edd1bbcf6a0f384089 /imap.h
parentAdd decoding stubs (diff)
downloadbubger-a4ed715f7237b99aee25288af07f472882eba24c.tar.gz
bubger-a4ed715f7237b99aee25288af07f472882eba24c.zip
Build a list of body parts parallel to structure
Diffstat (limited to 'imap.h')
-rw-r--r--imap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/imap.h b/imap.h
index 5919b8f..a2c13bd 100644
--- a/imap.h
+++ b/imap.h
@@ -117,6 +117,13 @@ static inline struct Data dataCheck(struct Data data, enum Type type) {
 	return data;
 }
 
+static inline struct Data dataTake(struct Data *from) {
+	struct Data take = *from;
+	from->type = Atom;
+	from->atom = AtomNil;
+	return take;
+}
+
 static inline void listPush(struct List *list, struct Data data) {
 	if (list->len == list->cap) {
 		list->cap = (list->cap ? list->cap * 2 : 4);