CRLF (filter)

From Mailutils
Revision as of 12:18, 26 October 2011 by Gray (talk | contribs)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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