Re-implement parser for RFC-2231 header fields.
The new implementation is able to return all parameters at once, in an associative array. A subset of parameters can be requested. The data are automatically converted to the output charset. In addition, RFC-2047 parser is extended to support language specifications (RFC-2231, chapter 5). * include/mailutils/message.h (MU_MIMEHDR_CSINFO) (MU_MIMEHDR_MULTILINE): Remove, not public anymore. (mu_mimehdr_get_param,mu_mimehdr_aget_param) (mu_message_aget_attachment_name) (mu_message_get_attachment_name): Remove pflags agrument. * include/mailutils/mime.h (mu_mime_param): New struct. (mu_rfc2047_decode_param) (mu_mime_header_parse,mu_mime_header_parse_subset): New proto. * libmailutils/base/rfc2047.c (_rfc2047_decode_param): New auxiliary function. Use memory stream to collect data. (mu_rfc2047_decode): Rewrite as a wrapper around the above. (mu_rfc2047_decode_param): New function. * libmailutils/filter/decode.c (mu_decode_filter_args): Pass actual (instead of maximal) number of arguments to mu_filter_chain_create. * libmailutils/mime/mimehdr.c: Rewrite from scratch. * libmailutils/tests/.gitignore: Add mimehdr. * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add mimehdr. (TESTSUITE_AT): Add mimehdr.at. * libmailutils/tests/mimehdr.at: New test. * libmailutils/tests/mimehdr.c: New test program. * libmailutils/tests/testsuite.at: Include.
Showing
10 changed files
with
1165 additions
and
589 deletions
libmailutils/tests/mimehdr.at
0 → 100644
libmailutils/tests/mimehdr.c
0 → 100644
-
Please register or sign in to post a comment