Difference between revisions of "CRLF (filter)"

From Mailutils
Jump to navigationJump to search
m
m
Line 28: Line 28:
  
 
[[Category:Filters]]
 
[[Category:Filters]]
 +
[[Category:C API]]

Revision as of 12:18, 26 October 2011

CRLF is a Mailutils filter which converts line separators from LF (ASCII 10) to CRLF (ASCII 13 10) and vice-versa.

In decode mode, the CRLF filter replaces each LF character with the CRLF sequence, unless LF is already preceded by a CR.

In encode mode, this filter removes CR from each CRLF sequence.

The following object, declared in the header mailutils/filter.h, describes this filter:

extern mu_filter_record_t mu_crlf_filter;

This filter does not take any arguments. The example below shows how to create a CRLF filter instance in decode mode for reading:

  int rc;          /* Return code */
  mu_stream_t flt; /* Filter stream */
  mu_stream_t input; /* Input stream */

  initialize_input_stream (&stream);
  rc = mu_filter_stream_create (&flt, input, "CRLF", MU_FILTER_DECODE, MU_STREAM_READ);

This filter is also available under the name RFC822, which is deprecated.

See also