Rocco Rutte:
[apps/madmutt.git] / mime.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 /* Content-Type */
11 enum {
12   TYPEOTHER,
13   TYPEAUDIO,
14   TYPEAPPLICATION,
15   TYPEIMAGE,
16   TYPEMESSAGE,
17   TYPEMODEL,
18   TYPEMULTIPART,
19   TYPETEXT,
20   TYPEVIDEO,
21   TYPEANY
22 };
23
24 /* Content-Transfer-Encoding */
25 enum {
26   ENCOTHER,
27   ENC7BIT,
28   ENC8BIT,
29   ENCQUOTEDPRINTABLE,
30   ENCBASE64,
31   ENCBINARY,
32   ENCUUENCODED
33 };
34
35 /* Content-Disposition values */
36 enum {
37   DISPINLINE,
38   DISPATTACH,
39   DISPFORMDATA
40 };
41
42 /* MIME encoding/decoding global vars */
43
44 #ifndef _SENDLIB_C
45 extern int Index_hex[];
46 extern int Index_64[];
47 extern char B64Chars[];
48 #endif
49
50 #define hexval(c) Index_hex[(unsigned int)(c)]
51 #define base64val(c) Index_64[(unsigned int)(c)]
52
53 #define is_multipart(x) \
54     ((x)->type == TYPEMULTIPART \
55      || ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
56                                       || !strcasecmp((x)->subtype, "news"))))
57
58 extern const char *BodyTypes[];
59 extern const char *BodyEncodings[];
60
61 #define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
62 #define ENCODING(X) BodyEncodings[(X)]
63
64 /* other MIME-related global variables */
65 #ifndef _SENDLIB_C
66 extern char MimeSpecials[];
67 #endif