]> diplodocus.org Git - nmh/blob - h/mime.h
pending-release-notes: add mhshow's "-prefer", and mh-format's %(kibi/kilo)
[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 PSEUDOHEADER_PREFIX "Nmh-"
16 #define ATTACH_FIELD PSEUDOHEADER_PREFIX "Attach"
17 #define ATTACH_FIELD_ALT "Attach"
18
19 #define isatom(c) (isascii((unsigned char) c) \
20 && !isspace ((unsigned char) c) \
21 && !iscntrl ((unsigned char) c) && (c) != '(' \
22 && (c) != ')' && (c) != '<' && (c) != '>' \
23 && (c) != '@' && (c) != ',' && (c) != ';' \
24 && (c) != ':' && (c) != '\\' && (c) != '"' \
25 && (c) != '.' && (c) != '[' && (c) != ']')
26
27 /*
28 * Test for valid characters used in "token"
29 * as defined in RFC2045
30 */
31 #define istoken(c) (isascii((unsigned char) c) \
32 && !isspace ((unsigned char) c) \
33 && !iscntrl ((unsigned char) c) && (c) != '(' \
34 && (c) != ')' && (c) != '<' && (c) != '>' \
35 && (c) != '@' && (c) != ',' && (c) != ';' \
36 && (c) != ':' && (c) != '\\' && (c) != '"' \
37 && (c) != '/' && (c) != '[' && (c) != ']' \
38 && (c) != '?' && (c) != '=')
39
40 /*
41 * Definitions for RFC 2231 encoding
42 */
43 #define istspecial(c) ((c) == '(' || (c) == ')' || (c) == '<' || (c) == '>' \
44 || (c) == '@' || (c) == ',' || (c) == ';' \
45 || (c) == ':' || (c) == '\\' || (c) == '"' \
46 || (c) == '/' || (c) == '[' || (c) == ']' \
47 || (c) == '?' || (c) == '=')
48
49 #define isparamencode(c) (!isascii((unsigned char) c) || \
50 iscntrl((unsigned char) c) || istspecial(c) || \
51 (c) == ' ' || (c) == '*' || (c) == '\'' || \
52 (c) == '%')
53
54 #define MAXTEXTPERLN 78
55 #define MAXLONGLINE 998
56 #define CPERLIN 76
57 #define BPERLIN (CPERLIN / 4)
58 #define LPERMSG 632
59 #define CPERMSG (LPERMSG * CPERLIN)
60