]> diplodocus.org Git - nmh/blob - h/mime.h
More cleaned and conversion to the new parameter API.
[nmh] / h / mime.h
1
2 /*
3 * mime.h -- definitions for MIME
4 */
5
6 #define VRSN_FIELD "MIME-Version"
7 #define VRSN_VALUE "1.0"
8 #define XXX_FIELD_PRF "Content-"
9 #define TYPE_FIELD "Content-Type"
10 #define ENCODING_FIELD "Content-Transfer-Encoding"
11 #define ID_FIELD "Content-ID"
12 #define DESCR_FIELD "Content-Description"
13 #define DISPO_FIELD "Content-Disposition"
14 #define MD5_FIELD "Content-MD5"
15 #define ATTACH_FIELD "Attach"
16
17 #define isatom(c) (isascii((unsigned char) c) \
18 && !isspace ((unsigned char) c) \
19 && !iscntrl ((unsigned char) c) && (c) != '(' \
20 && (c) != ')' && (c) != '<' && (c) != '>' \
21 && (c) != '@' && (c) != ',' && (c) != ';' \
22 && (c) != ':' && (c) != '\\' && (c) != '"' \
23 && (c) != '.' && (c) != '[' && (c) != ']')
24
25 /*
26 * Test for valid characters used in "token"
27 * as defined in RFC2045
28 */
29 #define istoken(c) (isascii((unsigned char) c) \
30 && !isspace ((unsigned char) c) \
31 && !iscntrl ((unsigned char) c) && (c) != '(' \
32 && (c) != ')' && (c) != '<' && (c) != '>' \
33 && (c) != '@' && (c) != ',' && (c) != ';' \
34 && (c) != ':' && (c) != '\\' && (c) != '"' \
35 && (c) != '/' && (c) != '[' && (c) != ']' \
36 && (c) != '?' && (c) != '=')
37
38 /*
39 * Definitions for RFC 2231 encoding
40 */
41 #define istspecial(c) ((c) == '(' || (c) == ')' || (c) == '<' || (c) == '>' \
42 || (c) == '@' || (c) == ',' || (c) == ';' \
43 || (c) == ':' || (c) == '\\' || (c) == '"' \
44 || (c) == '/' || (c) == '[' || (c) == ']' \
45 || (c) == '?' || (c) == '=')
46
47 #define isparamencode(c) (!isascii((unsigned char) c) || \
48 iscntrl((unsigned char) c) || istspecial(c) || \
49 (c) == ' ' || (c) == '*' || (c) == '\'' || \
50 (c) == '%')
51
52 #define MAXTEXTPERLN 78
53 #define MAXLONGLINE 998
54 #define CPERLIN 76
55 #define BPERLIN (CPERLIN / 4)
56 #define LPERMSG 632
57 #define CPERMSG (LPERMSG * CPERLIN)
58