Implement filter chains. Revamp filter output length support.
* include/mailutils/filter.h (mu_filter_chain_create_pred) (mu_filter_chain_create): New prototypes. (_mu_filter_record)<max_line_length>: Remove. * libmailutils/filter/fltchain.c: New file. * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add fltchain.c. * libmailutils/filter/base64.c: Implement line length limit for encoder. (base64_state): New enum. (base64_line): New struct. (_base64_encoder): xd brings a pointer to struct base64_line. Use it to limit the output line length. (alloc_state): New function. (_base64_filter): Register alloc_state. (_base64_filter, _B_filter): Remove max_line_length initialization. * libmailutils/filter/binflt.c: Remove max_line_length initialization. * libmailutils/filter/crlfflt.c: Likewise. * libmailutils/filter/dot.c: Likewise. * libmailutils/filter/fromflt.c: Likewise. * libmailutils/filter/header.c: Likewise. * libmailutils/filter/inline-comment.c: Likewise. * libmailutils/filter/linecon.c: Likewise. * libmailutils/filter/qpflt.c: Likewise. * libmailutils/filter/linelenflt.c: Redo line filter as a regular filter. (mu_linelen_filter): New global. * libmailutils/filter/filter.c (mu_filter_get_list): Register mu_linelen_filter. (filter_create_rd, filter_create_wr): Remove. (mu_filter_create_args): Use mu_filter_stream_create directly. * examples/base64.c: Re-implement the -l option via filter chains. * libmailutils/tests/fltst.c: Remove the linelen option. * libmailutils/tests/base64d.at: Remove the linelen option from fltst invocations. * mu/filter.c: Remove the --line-length option. Not needed now, its effect is achieved by "FLT + [~]linelen" chain.
Showing
19 changed files
with
347 additions
and
191 deletions
libmailutils/filter/fltchain.c
0 → 100644
-
Please register or sign in to post a comment