GMimeFilterCRLF

GMimeFilterCRLF — Convert line-endings from LF to CRLF or vise versa

Synopsis

struct              GMimeFilterCRLF;
GMimeFilter *       g_mime_filter_crlf_new              (gboolean encode,
                                                         gboolean dots);

Description

A GMimeFilter for converting between DOS and UNIX line-endings.

Details

struct GMimeFilterCRLF

struct GMimeFilterCRLF {
	GMimeFilter parent_object;
	
	gboolean encode;
	gboolean dots;
	
	gboolean saw_cr;
	gboolean saw_lf;
	gboolean saw_dot;
};

A filter to convert between line-ending formats and encode/decode lines beginning with a '.'.

GMimeFilter parent_object;

parent GMimeFilter

gboolean encode;

encoding vs decoding line endings/dots

gboolean dots;

gboolean saw_cr;

previous char was a CR

gboolean saw_lf;

previous char was a LF

gboolean saw_dot;

previous char was a period

g_mime_filter_crlf_new ()

GMimeFilter *       g_mime_filter_crlf_new              (gboolean encode,
                                                         gboolean dots);

Creates a new GMimeFilterCRLF filter.

If encode is TRUE, then lone line-feeds ('\n') will be 'encoded' into the canonical CRLF end-of-line sequence ("\r\n") otherwise CRLF sequences will be 'decoded' into the UNIX line-ending form ('\n').

The dots parameter tells the filter whether or not it should encode or decode lines beginning with a dot ('.'). If both encode and dots are TRUE, then a '.' at the beginning of a line will be 'encoded' into "..". If encode is FALSE, then ".." at the beginning of a line will be decoded into a single '.'.

encode :

TRUE if the filter should encode or FALSE otherwise

dots :

encode/decode dots (as for SMTP)

Returns :

a new GMimeFilterCRLF filter.