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