Integrate test_header in test_view_mail and various coding style modifications
[rmail.git] / src / utils / mime.h
blob30f4713e036a78707ba2ffef73786a75422bfe68
1 #ifndef MIME_H
2 #define MIME_H
4 /* http://www.iana.org/assignments/media-types/index.html */
6 /* MIME Content-Type */
7 enum mime_type {
8 MIME_TYPE_UNKNOWN = 0,
9 MIME_TYPE_APPLICATION,
10 MIME_TYPE_AUDIO,
11 MIME_TYPE_EXAMPLE,
12 MIME_TYPE_IMAGE,
13 MIME_TYPE_MESSAGE,
14 MIME_TYPE_MODEL,
15 MIME_TYPE_MULTIPART,
16 MIME_TYPE_TEXT,
17 MIME_TYPE_VIDEO
20 /* MIME Content-Disposition */
21 enum mime_disposition {
22 MIME_DISPOSITION_UNKNOWN = 0,
23 MIME_DISPOSITION_INLINE,
24 MIME_DISPOSITION_ATTACHMENT
27 /* MIME Content-Transfer-Encoding */
28 enum mime_encoding {
29 MIME_ENCODING_UNKNOWN = 0,
30 MIME_ENCODING_7BIT,
31 MIME_ENCODING_QUOTED_PRINTABLE,
32 MIME_ENCODING_BASE64,
33 MIME_ENCODING_8BIT,
34 MIME_ENCODING_BINARY
37 struct mime_header {
38 /* Content-Type */
39 enum mime_type type;
41 /* Subtypes */
42 unsigned int subtype;
44 /* Content-Disposition */
45 enum mime_disposition disposition;
47 /* Content-Transfer-Encoding */
48 enum mime_encoding transfer_encoding;
51 void mime_content_type(const char *buf, struct mime_header *hdr);
52 int mime_content_disposition(const char *buf);
53 int mime_content_transfer_encoding(const char *buf);
54 void debug_mime_header(const struct mime_header *hdr);
56 #endif /* MIME_H */