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 };
22
23 /* Content-Transfer-Encoding */
24 enum {
25   ENCOTHER,
26   ENC7BIT,
27   ENC8BIT,
28   ENCQUOTEDPRINTABLE,
29   ENCBASE64,
30   ENCBINARY,
31   ENCUUENCODED
32 };
33
34 /* Content-Disposition values */
35 enum {
36   DISPINLINE,
37   DISPATTACH,
38   DISPFORMDATA
39 };
40
41 /* MIME encoding/decoding global vars */
42
43 #ifndef _SENDLIB_C
44 extern int Index_hex[];
45 extern int Index_64[];
46 extern char B64Chars[];
47 #endif
48
49 #define hexval(c) Index_hex[(unsigned int)(c)]
50 #define base64val(c) Index_64[(unsigned int)(c)]
51
52 #define is_multipart(x) \
53     ((x)->type == TYPEMULTIPART \
54      || ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
55                                       || !strcasecmp((x)->subtype, "news"))))
56
57 extern const char *BodyTypes[];
58 extern const char *BodyEncodings[];
59
60 #define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
61 #define ENCODING(X) BodyEncodings[(X)]
62
63 /* other MIME-related global variables */
64 #ifndef _SENDLIB_C
65 extern char MimeSpecials[];
66 #endif