Difference between revisions of "Binary"
From Mailutils
Jump to navigationJump to searchm |
m |
||
Line 7: | Line 7: | ||
The following objects, declared in the header <tt>mailutils/filter.h</tt>, describe this filter: | The following objects, declared in the header <tt>mailutils/filter.h</tt>, describe this filter: | ||
− | < | + | <syntaxhighlight lang="C"> |
extern mu_filter_record_t mu_binary_filter; | extern mu_filter_record_t mu_binary_filter; | ||
extern mu_filter_record_t mu_bit8_filter; | extern mu_filter_record_t mu_bit8_filter; | ||
− | </ | + | </syntaxhighlight> |
An example of how to create a binary filter stream: | An example of how to create a binary filter stream: | ||
− | < | + | <syntaxhighlight lang="C"> |
int rc; /* Return code */ | int rc; /* Return code */ | ||
mu_stream_t flt; /* Filter stream */ | mu_stream_t flt; /* Filter stream */ | ||
Line 21: | Line 21: | ||
initialize_input_stream (&input); | initialize_input_stream (&input); | ||
rc = mu_filter_create (&flt, input, "8bit", MU_FILTER_DECODE, MU_STREAM_READ); | rc = mu_filter_create (&flt, input, "8bit", MU_FILTER_DECODE, MU_STREAM_READ); | ||
− | </ | + | </syntaxhighlight> |
[[Category:Filters]] | [[Category:Filters]] | ||
[[Category:C API]] | [[Category:C API]] |
Latest revision as of 13:20, 16 October 2023
Binary is the simplest of Mailtils filters. In both decode and encode modes, the filter copies its input to output verbatim.
This filter is also available under the alias 8bit.
The binary filter takes no arguments.
The following objects, declared in the header mailutils/filter.h, describe this filter:
extern mu_filter_record_t mu_binary_filter;
extern mu_filter_record_t mu_bit8_filter;
An example of how to create a binary filter stream:
int rc; /* Return code */
mu_stream_t flt; /* Filter stream */
mu_stream_t input; /* Input stream */
initialize_input_stream (&input);
rc = mu_filter_create (&flt, input, "8bit", MU_FILTER_DECODE, MU_STREAM_READ);