]> diplodocus.org Git - nmh/blob - h/mime.h
Escape literal leading full stop in man/new.man.
[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 #define isatom(c) (isascii((unsigned char) c) \
22 && !isspace ((unsigned char) c) \
23 && !iscntrl ((unsigned char) c) && (c) != '(' \
24 && (c) != ')' && (c) != '<' && (c) != '>' \
25 && (c) != '@' && (c) != ',' && (c) != ';' \
26 && (c) != ':' && (c) != '\\' && (c) != '"' \
27 && (c) != '.' && (c) != '[' && (c) != ']')
28
29 /*
30 * Test for valid characters used in "token"
31 * as defined in RFC2045
32 */
33 #define istoken(c) (isascii((unsigned char) c) \
34 && !isspace ((unsigned char) c) \
35 && !iscntrl ((unsigned char) c) && (c) != '(' \
36 && (c) != ')' && (c) != '<' && (c) != '>' \
37 && (c) != '@' && (c) != ',' && (c) != ';' \
38 && (c) != ':' && (c) != '\\' && (c) != '"' \
39 && (c) != '/' && (c) != '[' && (c) != ']' \
40 && (c) != '?' && (c) != '=')
41
42 /*
43 * Definitions for RFC 2231 encoding
44 */
45 #define istspecial(c) ((c) == '(' || (c) == ')' || (c) == '<' || (c) == '>' \
46 || (c) == '@' || (c) == ',' || (c) == ';' \
47 || (c) == ':' || (c) == '\\' || (c) == '"' \
48 || (c) == '/' || (c) == '[' || (c) == ']' \
49 || (c) == '?' || (c) == '=')
50
51 #define isparamencode(c) (!isascii((unsigned char) c) || \
52 iscntrl((unsigned char) c) || istspecial(c) || \
53 (c) == ' ' || (c) == '*' || (c) == '\'' || \
54 (c) == '%')
55
56 #define MAXTEXTPERLN 78
57 #define MAXLONGLINE 998
58 #define CPERLIN 76
59 #define BPERLIN (CPERLIN / 4)
60 #define LPERMSG 632
61 #define CPERMSG (LPERMSG * CPERLIN)
62