GMimeDomainList

GMimeDomainList — Mailbox source-route domains

Functions

Types and Values

Description

A mutable collection of domains. Changes propagate to the owning mailbox.

Functions

g_mime_domain_list_new ()

GMimeDomainList *
g_mime_domain_list_new (void);

Returns

a new empty domain list.

[transfer full]


g_mime_domain_list_clone ()

GMimeDomainList *
g_mime_domain_list_clone (GMimeDomainList *list);

Parameters

list

a GMimeDomainList

 

Returns

an independent copy of list .

[transfer full]


g_mime_domain_list_length ()

int
g_mime_domain_list_length (GMimeDomainList *list);

Parameters

list

a GMimeDomainList

 

Returns

the number of domains, including empty entries.


g_mime_domain_list_clear ()

void
g_mime_domain_list_clear (GMimeDomainList *list);

Removes all domains.

Parameters

list

a GMimeDomainList

 

g_mime_domain_list_add ()

int
g_mime_domain_list_add (GMimeDomainList *list,
                        const char *domain);

Appends domain without trimming it.

Parameters

list

a GMimeDomainList

 

domain

a UTF-8 domain

 

Returns

the index of the added domain.


g_mime_domain_list_insert ()

void
g_mime_domain_list_insert (GMimeDomainList *list,
                           int index,
                           const char *domain);

Inserts domain at index without trimming it.

Parameters

list

a GMimeDomainList

 

index

an index between zero and the list length, inclusive

 

domain

a UTF-8 domain

 

g_mime_domain_list_remove ()

gboolean
g_mime_domain_list_remove (GMimeDomainList *list,
                           const char *domain);

Removes the first case-sensitive match.

Parameters

list

a GMimeDomainList

 

domain

a domain

 

Returns

whether a domain was removed.


g_mime_domain_list_remove_at ()

gboolean
g_mime_domain_list_remove_at (GMimeDomainList *list,
                              int index);

Parameters

list

a GMimeDomainList

 

index

the index to remove

 

Returns

whether a domain was removed.


g_mime_domain_list_contains ()

gboolean
g_mime_domain_list_contains (GMimeDomainList *list,
                             const char *domain);

Parameters

list

a GMimeDomainList

 

domain

a domain

 

Returns

whether list contains a case-sensitive match for domain .


g_mime_domain_list_index_of ()

int
g_mime_domain_list_index_of (GMimeDomainList *list,
                             const char *domain);

Parameters

list

a GMimeDomainList

 

domain

a domain

 

Returns

the first case-sensitive match, or -1.


g_mime_domain_list_get_domain ()

const char *
g_mime_domain_list_get_domain (GMimeDomainList *list,
                               int index);

Parameters

list

a GMimeDomainList

 

index

an existing index

 

Returns

the domain, or NULL for an invalid index.

[nullable][transfer none]


g_mime_domain_list_set_domain ()

void
g_mime_domain_list_set_domain (GMimeDomainList *list,
                               int index,
                               const char *domain);

Replaces an entry. Assigning the same value does not emit a change.

Parameters

list

a GMimeDomainList

 

index

an existing index

 

domain

a UTF-8 domain

 

g_mime_domain_list_to_string ()

char *
g_mime_domain_list_to_string (GMimeDomainList *list,
                              GMimeFormatOptions *options,
                              gboolean encode);

Empty and ASCII-linear-whitespace-only entries (SP, HTAB, CR and LF) are omitted. Other entries are preserved, prefixed with '@', and separated by commas.

Parameters

list

a GMimeDomainList

 

options

formatting options.

[nullable]

encode

whether to encode international domain names

 

Returns

the formatted source route, without a colon.

[transfer full]


g_mime_domain_list_parse ()

GMimeDomainList *
g_mime_domain_list_parse (const char *str,
                          gssize length,
                          GError **error);

Parses a complete domain list, allowing comments and empty comma entries. Unlike mailbox source-route syntax, str must not include a trailing colon. Explicitly bounded input need not be NUL-terminated but cannot contain embedded NUL bytes.

Parameters

str

source-route text beginning with '@'

 

length

byte length, or -1 for a NUL-terminated string

 

error

return location for a GError.

[nullable]

Returns

the domains, or NULL on error.

[nullable][transfer full]

Types and Values

GMimeDomainList

typedef struct _GMimeDomainList GMimeDomainList;

An ordered collection of source-route domains.