message-part.h revision f684e87d4e2d192efdf5984d18fcede3f5a33771
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen#ifndef MESSAGE_PART_H
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen#define MESSAGE_PART_H
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen#include "message-size.h"
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen/* Note that these flags are used directly by message-parser-serialize, so
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen existing flags can't be changed without breaking backwards compatibility */
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainenenum message_part_flags {
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen MESSAGE_PART_FLAG_MULTIPART = 0x01,
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen MESSAGE_PART_FLAG_MULTIPART_DIGEST = 0x02,
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen MESSAGE_PART_FLAG_MESSAGE_RFC822 = 0x04,
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen /* content-type: text/... */
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen MESSAGE_PART_FLAG_TEXT = 0x08,
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen MESSAGE_PART_FLAG_UNUSED = 0x10,
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen /* message part header or body contains NULs */
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen MESSAGE_PART_FLAG_HAS_NULS = 0x20,
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen /* Mime-Version header exists. */
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen MESSAGE_PART_FLAG_IS_MIME = 0x40
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen};
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainenstruct message_part {
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen struct message_part *parent;
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen struct message_part *next;
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen struct message_part *children;
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen uoff_t physical_pos; /* absolute position from beginning of message */
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen struct message_size header_size;
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen struct message_size body_size;
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen enum message_part_flags flags;
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen void *context;
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen};
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen#endif
9afebd21ced1d43f638e08a1411c9a89e526231fTimo Sirainen