mutt stable branch with some hacks
1/*
2 * Copyright (C) 1996-2000,2010 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19/* Content-Type */
20enum
21{
22 TYPEOTHER,
23 TYPEAUDIO,
24 TYPEAPPLICATION,
25 TYPEIMAGE,
26 TYPEMESSAGE,
27 TYPEMODEL,
28 TYPEMULTIPART,
29 TYPETEXT,
30 TYPEVIDEO,
31 TYPEANY
32};
33
34/* Content-Transfer-Encoding */
35enum
36{
37 ENCOTHER,
38 ENC7BIT,
39 ENC8BIT,
40 ENCQUOTEDPRINTABLE,
41 ENCBASE64,
42 ENCBINARY,
43 ENCUUENCODED
44};
45
46/* Content-Disposition values */
47enum
48{
49 DISPINLINE,
50 DISPATTACH,
51 DISPFORMDATA,
52 DISPNONE /* no preferred disposition */
53};
54
55/* MIME encoding/decoding global vars */
56
57#ifndef _SENDLIB_C
58extern const int Index_hex[];
59extern const int Index_64[];
60extern const char B64Chars[];
61#endif
62
63#define hexval(c) Index_hex[(unsigned int)(c)]
64#define base64val(c) Index_64[(unsigned int)(c)]
65
66#define is_multipart(x) \
67 ((x)->type == TYPEMULTIPART \
68 || ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
69 || !strcasecmp((x)->subtype, "news"))))
70
71extern const char *BodyTypes[];
72extern const char *BodyEncodings[];
73
74#define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
75#define ENCODING(X) BodyEncodings[(X)]
76
77/* other MIME-related global variables */
78#ifndef _SENDLIB_C
79extern char MimeSpecials[];
80#endif