GMimeFilterUnix2Dos

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

Functions

Types and Values

Description

Converts bare LF bytes to CRLF, preserving existing CRLF pairs even when split across input buffers. All other bytes, including bare CR, are preserved. If ensure_newline is enabled, completion appends a missing CRLF, or only LF when the input already ends in CR.

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_unix2dos_new ()

GMimeFilter *
g_mime_filter_unix2dos_new (gboolean ensure_newline);

Creates a new GMimeFilterUnix2Dos filter. Bare LF bytes are converted to CRLF without duplicating existing CR bytes. With ensure_newline , even empty input completes with CRLF.

Parameters

ensure_newline

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

 

Returns

a new GMimeFilterUnix2Dos filter.

[transfer full]

Types and Values

GMimeFilterUnix2Dos

typedef struct _GMimeFilterUnix2Dos GMimeFilterUnix2Dos;

A filter converting bare LF bytes to CRLF while preserving existing CRLF pairs and other bytes.