]> diplodocus.org Git - nmh/blob - h/mime.h
uip/dropsbr.c: Fix buffer overrun in mbx_copy().
[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 #define MHBUILD_FILE_PSEUDOHEADER PSEUDOHEADER_PREFIX "mhbuild-file-"
19 #define MHBUILD_ARGS_PSEUDOHEADER PSEUDOHEADER_PREFIX "mhbuild-args-"
20
21 /*
22 * Test for valid characters used in "token"
23 * as defined in RFC2045
24 */
25 #define istoken(c) (isascii((unsigned char) c) \
26 && !isspace ((unsigned char) c) \
27 && !iscntrl ((unsigned char) c) && (c) != '(' \
28 && (c) != ')' && (c) != '<' && (c) != '>' \
29 && (c) != '@' && (c) != ',' && (c) != ';' \
30 && (c) != ':' && (c) != '\\' && (c) != '"' \
31 && (c) != '/' && (c) != '[' && (c) != ']' \
32 && (c) != '?' && (c) != '=')
33
34 /*
35 * Definitions for RFC 2231 encoding
36 */
37 #define istspecial(c) ((c) == '(' || (c) == ')' || (c) == '<' || (c) == '>' \
38 || (c) == '@' || (c) == ',' || (c) == ';' \
39 || (c) == ':' || (c) == '\\' || (c) == '"' \
40 || (c) == '/' || (c) == '[' || (c) == ']' \
41 || (c) == '?' || (c) == '=')
42
43 #define isparamencode(c) (!isascii((unsigned char) c) || \
44 iscntrl((unsigned char) c) || istspecial(c) || \
45 (c) == ' ' || (c) == '*' || (c) == '\'' || \
46 (c) == '%')
47
48 #define MAXTEXTPERLN 78
49 #define MAXLONGLINE 998
50 #define CPERLIN 76
51 #define BPERLIN (CPERLIN / 4)
52 #define LPERMSG 632
53 #define CPERMSG (LPERMSG * CPERLIN)
54