| Top |
Compliance findings describe the original wire bytes without changing parsing or decoding. Transport and storage contexts affect severity only. Reader operations snapshot their options and reset per-violation budgets.
void (*GMimeComplianceIssueFunc) (const GMimeComplianceIssue *issue,gpointer user_data);
Receives a compliance finding without changing how MIME data is parsed.
issue |
the diagnostic, borrowed during the callback. |
[transfer none] |
user_data |
application data |
GMimeComplianceOptions *
g_mime_compliance_options_new (void);
Enables all validators in transport context, without a reporting limit.
GMimeComplianceOptions *
g_mime_compliance_options_get_default (void);
Gets application-wide defaults. Configure these once at startup, before creating readers; concurrent mutation is not supported.
The returned reference belongs to GMime. Use g_mime_compliance_options_ref()
to retain it independently, or g_mime_compliance_options_clone() for a copy.
GMimeComplianceOptions *
g_mime_compliance_options_clone (GMimeComplianceOptions *options);
Copies the settings independently. Unlike g_mime_compliance_options_ref()
or g_boxed_copy(), this does not share settings.
GMimeComplianceOptions *
g_mime_compliance_options_ref (GMimeComplianceOptions *options);
Atomically acquires a reference to options
. This shares the same settings;
concurrent changes to the settings still require external synchronization.
void
g_mime_compliance_options_unref (GMimeComplianceOptions *options);
Atomically releases a reference to options
. The options are destroyed
when the last reference is released.
GMimeComplianceContext
g_mime_compliance_options_get_context (GMimeComplianceOptions *options);
void g_mime_compliance_options_set_context (GMimeComplianceOptions *options,GMimeComplianceContext context);
Sets severity context without affecting which defects are detected.
GMimeComplianceValidators
g_mime_compliance_options_get_enabled_validators
(GMimeComplianceOptions *options);
void g_mime_compliance_options_set_enabled_validators (GMimeComplianceOptions *options,GMimeComplianceValidators validators);
Selects specialized validators. General wire and structure checks remain enabled when a reader has a compliance logger.
guint
g_mime_compliance_options_get_max_issues_per_violation
(GMimeComplianceOptions *options);
void g_mime_compliance_options_set_max_issues_per_violation (GMimeComplianceOptions *options,guint limit);
Limits reporting independently for each violation in a reader operation. The first suppressed finding produces one TOO_MANY_COMPLIANCE_ISSUES marker; other violations still have their own budgets.
GMimeComplianceIssue * g_mime_compliance_issue_new (GMimeComplianceContext context,GMimeComplianceViolation violation,gint64 stream_offset,guint64 line_number,guint64 column_number,GMimeCompliancePositionKind position_kind);
GMimeComplianceIssue *
g_mime_compliance_issue_copy (const GMimeComplianceIssue *issue);
void
g_mime_compliance_issue_free (GMimeComplianceIssue *issue);
Releases a diagnostic.
gboolean g_mime_compliance_issue_equal (const GMimeComplianceIssue *a,const GMimeComplianceIssue *b);
char *
g_mime_compliance_issue_to_string (const GMimeComplianceIssue *issue);
GMimeComplianceSeverity g_mime_compliance_violation_get_severity (GMimeComplianceViolation violation,GMimeComplianceContext context);
GMimeComplianceCategories
g_mime_compliance_violation_get_categories
(GMimeComplianceViolation violation);
const char *
g_mime_compliance_violation_get_name (GMimeComplianceViolation violation);
const char *
g_mime_compliance_violation_get_description
(GMimeComplianceViolation violation);
const char *
g_mime_compliance_violation_get_remarks
(GMimeComplianceViolation violation);
General header, structure and content checks remain enabled whenever a logger is installed. These flags select additional grammar validators.
|
disable specialized validators |
||
|
validate base64 wire content |
||
|
validate quoted-printable content |
||
|
validate uuencoded content |
||
|
validate address header grammar |
||
|
validate malformed or repeated parameters, RFC 2047 encoded-words, malformed RFC 2231 encoded values, and missing continuation segments in Content-Type and Content-Disposition |
||
|
validate RFC 2047 syntax in address headers, Subject, Comments, Content-Description and X- headers, including address placement; independent of address syntax and parameter validation |
||
|
enable all specialized validators |
Use the violation metadata functions for names, descriptions, remarks and context-specific severity.
typedef struct {
GMimeComplianceContext context;
GMimeComplianceViolation violation;
gint64 stream_offset;
guint64 line_number;
guint64 column_number;
GMimeCompliancePositionKind position_kind;
} GMimeComplianceIssue;
A boxed diagnostic referring to the original wire bytes.
GMimeComplianceContext |
reporting context |
|
GMimeComplianceViolation |
diagnostic identity |
|
absolute input byte offset |
||
1-based physical line number |
||
1-based byte column, or zero if unknown |
||
GMimeCompliancePositionKind |
interpretation of the input position |
typedef struct _GMimeComplianceOptions GMimeComplianceOptions;
Reference-counted boxed diagnostic options. References and boxed copies share settings; explicit clones and internal snapshots remain independent. Reader operations snapshot these values; changing them never changes the parsing policy.