X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f93ce652c5d1361b00a28db7bbb9e638197a6676..ab7f4c906111c206b91236ed8c210e681c85f338:/h/mime.h diff --git a/h/mime.h b/h/mime.h index d152094a..be854425 100644 --- a/h/mime.h +++ b/h/mime.h @@ -12,15 +12,11 @@ #define DESCR_FIELD "Content-Description" #define DISPO_FIELD "Content-Disposition" #define MD5_FIELD "Content-MD5" -#define ATTACH_FIELD "Attach" - -#define isatom(c) (isascii((unsigned char) c) \ - && !isspace ((unsigned char) c) \ - && !iscntrl ((unsigned char) c) && (c) != '(' \ - && (c) != ')' && (c) != '<' && (c) != '>' \ - && (c) != '@' && (c) != ',' && (c) != ';' \ - && (c) != ':' && (c) != '\\' && (c) != '"' \ - && (c) != '.' && (c) != '[' && (c) != ']') +#define PSEUDOHEADER_PREFIX "Nmh-" +#define ATTACH_FIELD PSEUDOHEADER_PREFIX "Attach" +#define ATTACH_FIELD_ALT "Attach" +#define MHBUILD_FILE_PSEUDOHEADER PSEUDOHEADER_PREFIX "mhbuild-file-" +#define MHBUILD_ARGS_PSEUDOHEADER PSEUDOHEADER_PREFIX "mhbuild-args-" /* * Test for valid characters used in "token" @@ -35,6 +31,20 @@ && (c) != '/' && (c) != '[' && (c) != ']' \ && (c) != '?' && (c) != '=') +/* + * Definitions for RFC 2231 encoding + */ +#define istspecial(c) ((c) == '(' || (c) == ')' || (c) == '<' || (c) == '>' \ + || (c) == '@' || (c) == ',' || (c) == ';' \ + || (c) == ':' || (c) == '\\' || (c) == '"' \ + || (c) == '/' || (c) == '[' || (c) == ']' \ + || (c) == '?' || (c) == '=') + +#define isparamencode(c) (!isascii((unsigned char) c) || \ + iscntrl((unsigned char) c) || istspecial(c) || \ + (c) == ' ' || (c) == '*' || (c) == '\'' || \ + (c) == '%') + #define MAXTEXTPERLN 78 #define MAXLONGLINE 998 #define CPERLIN 76