GMimeTnefOptions

GMimeTnefOptions — Configure TNEF decoding limits and compliance reporting

Functions

Types and Values

Description

Functions

GMimeTnefComplianceLogger ()

void
(*GMimeTnefComplianceLogger) (const GMimeTnefComplianceIssue *issue,
                              gpointer user_data);

Receives TNEF diagnostics. Callbacks must not reenter the reader.

Parameters

issue

a diagnostic valid during this callback.

[transfer none]

user_data

callback data.

[closure][nullable]

g_mime_tnef_options_new ()

GMimeTnefOptions *
g_mime_tnef_options_new (void);

Creates default TNEF options.

Returns

new options.

[transfer full]


g_mime_tnef_options_ref ()

GMimeTnefOptions *
g_mime_tnef_options_ref (GMimeTnefOptions *options);

References the options.

Parameters

options

options to reference

 

Returns

options .

[transfer full]


g_mime_tnef_options_unref ()

void
g_mime_tnef_options_unref (GMimeTnefOptions *options);

Releases a reference to the options.

Parameters

options

options to release

 

g_mime_tnef_options_clone ()

GMimeTnefOptions *
g_mime_tnef_options_clone (const GMimeTnefOptions *options);

Copies the options.

Parameters

options

options to copy

 

Returns

independent options.

[transfer full]


g_mime_tnef_options_get_max_nesting_depth ()

guint
g_mime_tnef_options_get_max_nesting_depth
                               (const GMimeTnefOptions *options);

Gets the maximum embedded-message depth; zero disallows nesting. Default: 32.

Parameters

options

TNEF options

 

Returns

the configured value


g_mime_tnef_options_set_max_nesting_depth ()

void
g_mime_tnef_options_set_max_nesting_depth
                               (GMimeTnefOptions *options,
                                guint maximum);

Sets the maximum embedded-message depth; zero disallows nesting.

Parameters

options

TNEF options

 

maximum

maximum embedded-message depth; zero disallows nesting

 

g_mime_tnef_options_get_max_property_value_length ()

guint
g_mime_tnef_options_get_max_property_value_length
                               (const GMimeTnefOptions *options);

Gets the maximum bytes materialized for one value. Default: 32 * 1024 * 1024.

Parameters

options

TNEF options

 

Returns

the configured value


g_mime_tnef_options_set_max_property_value_length ()

void
g_mime_tnef_options_set_max_property_value_length
                               (GMimeTnefOptions *options,
                                guint maximum);

Sets the maximum bytes materialized for one value.

Parameters

options

TNEF options

 

maximum

maximum bytes materialized for one value

 

g_mime_tnef_options_get_max_total_data_bytes ()

guint64
g_mime_tnef_options_get_max_total_data_bytes
                               (const GMimeTnefOptions *options);

Gets the cumulative materialization budget shared with embedded readers. Default: 64 * 1024 * 1024.

Parameters

options

TNEF options

 

Returns

the configured value


g_mime_tnef_options_set_max_total_data_bytes ()

void
g_mime_tnef_options_set_max_total_data_bytes
                               (GMimeTnefOptions *options,
                                guint64 maximum);

Sets the cumulative materialization budget shared with embedded readers.

Parameters

options

TNEF options

 

maximum

cumulative materialization budget shared with embedded readers

 

g_mime_tnef_options_get_max_attachments ()

guint
g_mime_tnef_options_get_max_attachments
                               (const GMimeTnefOptions *options);

Parameters

options

TNEF options

 

Returns

the number of attachments a message may retain (default: 1024).


g_mime_tnef_options_set_max_attachments ()

void
g_mime_tnef_options_set_max_attachments
                               (GMimeTnefOptions *options,
                                guint maximum);

Limits attachment materialization. Zero skips all attachments.

Parameters

options

TNEF options

 

maximum

maximum number of attachments per message

 

g_mime_tnef_options_get_default_codepage ()

int
g_mime_tnef_options_get_default_codepage
                               (const GMimeTnefOptions *options);

Gets the default codepage; zero selects Windows-1252. Default: 0.

Parameters

options

TNEF options

 

Returns

the configured value


g_mime_tnef_options_set_default_codepage ()

void
g_mime_tnef_options_set_default_codepage
                               (GMimeTnefOptions *options,
                                int codepage);

Sets the default codepage; zero selects Windows-1252.

Parameters

options

TNEF options

 

codepage

default codepage; zero selects Windows-1252

 

g_mime_tnef_compliance_options_new ()

GMimeTnefComplianceOptions *
g_mime_tnef_compliance_options_new (void);

Creates default TNEF options.

Returns

new options.

[transfer full]


g_mime_tnef_compliance_options_ref ()

GMimeTnefComplianceOptions *
g_mime_tnef_compliance_options_ref (GMimeTnefComplianceOptions *options);

References the options.

Parameters

options

options to reference

 

Returns

options .

[transfer full]


g_mime_tnef_compliance_options_unref ()

void
g_mime_tnef_compliance_options_unref (GMimeTnefComplianceOptions *options);

Releases a reference to the options.

Parameters

options

options to release

 

g_mime_tnef_compliance_options_clone ()

GMimeTnefComplianceOptions *
g_mime_tnef_compliance_options_clone (const GMimeTnefComplianceOptions *options);

Copies the options.

Parameters

options

options to copy

 

Returns

independent options.

[transfer full]


g_mime_tnef_compliance_options_get_max_issues_per_violation ()

guint
g_mime_tnef_compliance_options_get_max_issues_per_violation
                               (const GMimeTnefComplianceOptions *options);

Gets the per-violation reporting cap; zero means unlimited. Default: 0.

Parameters

options

TNEF options

 

Returns

the configured value


g_mime_tnef_compliance_options_set_max_issues_per_violation ()

void
g_mime_tnef_compliance_options_set_max_issues_per_violation
                               (GMimeTnefComplianceOptions *options,
                                guint maximum);

Sets the per-violation reporting cap; zero means unlimited.

Parameters

options

TNEF options

 

maximum

per-violation reporting cap; zero means unlimited

 

g_mime_tnef_compliance_violation_get_description ()

const char *
g_mime_tnef_compliance_violation_get_description
                               (GMimeTnefComplianceViolation violation);

Gets the diagnostic description.

Parameters

violation

a genuine TNEF violation, not NONE

 

Returns

the diagnostic description.

[transfer none]


g_mime_tnef_compliance_violation_get_remarks ()

const char *
g_mime_tnef_compliance_violation_get_remarks
                               (GMimeTnefComplianceViolation violation);

Gets the diagnostic remarks.

Parameters

violation

a genuine TNEF violation, not NONE

 

Returns

the diagnostic remarks.

[transfer none]


g_mime_tnef_compliance_violation_get_severity ()

GMimeComplianceSeverity
g_mime_tnef_compliance_violation_get_severity
                               (GMimeTnefComplianceViolation violation);

Gets the diagnostic severity.

Parameters

violation

a genuine TNEF violation, not NONE

 

Returns

the diagnostic severity


g_mime_tnef_compliance_violation_get_categories ()

GMimeComplianceCategories
g_mime_tnef_compliance_violation_get_categories
                               (GMimeTnefComplianceViolation violation);

Gets the diagnostic categories.

Parameters

violation

a genuine TNEF violation, not NONE

 

Returns

the diagnostic categories

Types and Values

GMimeTnefOptions

typedef struct _GMimeTnefOptions GMimeTnefOptions;

Reference-counted limits and default encoding for low-level TNEF reading. Readers copy these options at construction. Materialization limits do not restrict streaming values.


GMimeTnefComplianceOptions

typedef struct _GMimeTnefComplianceOptions GMimeTnefComplianceOptions;

Reference-counted diagnostic reporting limits.


GMimeTnefComplianceIssue

typedef struct {
	GMimeTnefComplianceViolation violation;
	GMimeComplianceSeverity severity;
	GMimeComplianceCategories categories;
	gint64 stream_offset;
	guint depth;
	GMimeTnefAttributeTag attribute_tag;
	GMimeTnefPropertyTag property_tag;
	const char *description;
} GMimeTnefComplianceIssue;

A diagnostic borrowed for the duration of a compliance callback.

Members

GMimeTnefComplianceViolation violation;

the reported violation

 

GMimeComplianceSeverity severity;

diagnostic severity

 

GMimeComplianceCategories categories;

diagnostic categories

 

gint64 stream_offset;

byte offset relative to the outermost TNEF stream

 

guint depth;

embedded message depth

 

GMimeTnefAttributeTag attribute_tag;

associated attribute, or zero

 

GMimeTnefPropertyTag property_tag;

associated property, or zero

 

const char *description;

borrowed diagnostic description.

[transfer none]