GMimeFilterDos2Unix

GMimeFilterDos2Unix — Convert line-endings from Windows/DOS (CRLF) to UNIX (LF).

Functions

Types and Values

Description

Converts CRLF pairs to LF, including pairs split across input buffers. All other bytes are preserved, including a trailing bare CR on completion. If ensure_newline is enabled, completion ensures a final LF instead; a trailing bare CR is combined with that newline and converted to LF.

Repeated empty completion calls add no further output. Reset discards conversion state; copying preserves the ensure_newline setting but creates a fresh filter without buffered input.

Functions

g_mime_filter_dos2unix_new ()

GMimeFilter *
g_mime_filter_dos2unix_new (gboolean ensure_newline);

Creates a new GMimeFilterDos2Unix filter. CRLF pairs are converted to LF; bare CR bytes are preserved unless a trailing CR is combined with the newline requested by ensure_newline . With ensure_newline , even empty input completes with a single LF.

Parameters

ensure_newline

TRUE if the filter should ensure that the stream ends in a new line

 

Returns

a new GMimeFilterDos2Unix filter.

[transfer full]

Types and Values

GMimeFilterDos2Unix

typedef struct _GMimeFilterDos2Unix GMimeFilterDos2Unix;

A filter converting CRLF pairs to LF while preserving other bytes. A trailing bare CR is preserved unless ensure_newline is enabled.