d6ea4964709ef93c395b95b08f4ed791a02df0b2
[apps/madmutt.git] / mime.h
1 /*
2  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
3  * 
4  *     This program is free software; you can redistribute it and/or modify
5  *     it under the terms of the GNU General Public License as published by
6  *     the Free Software Foundation; either version 2 of the License, or
7  *     (at your option) any later version.
8  * 
9  *     This program is distributed in the hope that it will be useful,
10  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *     GNU General Public License for more details.
13  * 
14  *     You should have received a copy of the GNU General Public License
15  *     along with this program; if not, write to the Free Software
16  *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
17  */
18
19 /* Content-Type */
20 enum {
21   TYPEOTHER,
22   TYPEAUDIO,
23   TYPEAPPLICATION,
24   TYPEIMAGE,
25   TYPEMESSAGE,
26   TYPEMODEL,
27   TYPEMULTIPART,
28   TYPETEXT,
29   TYPEVIDEO
30 };
31
32 /* Content-Transfer-Encoding */
33 enum {
34   ENCOTHER,
35   ENC7BIT,
36   ENC8BIT,
37   ENCQUOTEDPRINTABLE,
38   ENCBASE64,
39   ENCBINARY,
40   ENCUUENCODED
41 };
42
43 /* Content-Disposition values */
44 enum {
45   DISPINLINE,
46   DISPATTACH,
47   DISPFORMDATA
48 };
49
50 /* MIME encoding/decoding global vars */
51
52 #ifndef _SENDLIB_C
53 extern int Index_hex[];
54 extern int Index_64[];
55 extern char B64Chars[];
56 #endif
57
58 #define hexval(c) Index_hex[(unsigned int)(c)]
59 #define base64val(c) Index_64[(unsigned int)(c)]
60
61 #define is_multipart(x) \
62     ((x)->type == TYPEMULTIPART \
63      || ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
64                                       || !strcasecmp((x)->subtype, "news"))))
65
66 extern const char *BodyTypes[];
67 extern const char *BodyEncodings[];
68
69 #define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
70 #define ENCODING(X) BodyEncodings[(X)]
71
72 /* other MIME-related global variables */
73 #ifndef _SENDLIB_C
74 extern char MimeSpecials[];
75 #endif