GMimeInternetAddress

GMimeInternetAddress — Internet addresses

Functions

Types and Values

Description

An GMimeInternetAddress is the base class for GMimeGroupAddress and GMimeMailboxAddress.

Functions

g_mime_internet_address_get_name ()

const char *
g_mime_internet_address_get_name (GMimeInternetAddress *ia);

Gets the display name of the GMimeInternetAddress.

Parameters

Returns

the name of the mailbox or group in a form suitable for display if available or NULL otherwise. If the name is available, the returned string will be in UTF-8.

[nullable]


g_mime_internet_address_set_name ()

void
g_mime_internet_address_set_name (GMimeInternetAddress *ia,
                                  const char *name);

Set the display name of the GMimeInternetAddress. Leading and trailing ASCII linear whitespace (SP, HTAB, CR and LF) is removed; interior whitespace, VT, FF and Unicode whitespace are preserved. NULL remains distinct from an empty name. An unchanged name does not emit a change notification.

Note: The name string should be in UTF-8.

Parameters

ia

a GMimeInternetAddress

 

name

the display name for the address group or mailbox.

[nullable]

g_mime_internet_address_get_charset ()

const char *
g_mime_internet_address_get_charset (GMimeInternetAddress *ia);

Gets the charset to be used when encoding the name of the mailbox or group.

Parameters

Returns

the charset to be used when encoding the name of the mailbox or group if available or NULL otherwise.

[nullable]


g_mime_internet_address_set_charset ()

void
g_mime_internet_address_set_charset (GMimeInternetAddress *ia,
                                     const char *charset);

Set the charset to use for encoding the name of the mailbox or group. A NULL charset selects UTF-8.

Parameters

ia

a GMimeInternetAddress

 

charset

the charset to use when encoding the name or NULL to use the defaults.

[nullable]

g_mime_internet_address_to_string ()

char *
g_mime_internet_address_to_string (GMimeInternetAddress *ia,
                                   GMimeFormatOptions *options,
                                   gboolean encode);

Allocates a string containing the contents of the GMimeInternetAddress object.

Parameters

ia

Internet Address object

 

options

a GMimeFormatOptions or NULL.

[nullable]

encode

TRUE if the address should be rfc2047 encoded

 

Returns

the GMimeInternetAddress object as an allocated string in rfc822 format.


g_mime_internet_address_clone ()

GMimeInternetAddress *
g_mime_internet_address_clone (GMimeInternetAddress *ia);

Copies the name, charset, mailbox route, and all nested group members.

Parameters

Returns

an independent deep copy.

[transfer full]


g_mime_internet_address_equal ()

gboolean
g_mime_internet_address_equal (GMimeInternetAddress *ia,
                               GMimeInternetAddress *other);

Compares nullable names and mailbox addresses case-sensitively. Groups additionally compare their members recursively and in order. Charsets and mailbox source routes do not participate in equality.

Parameters

Returns

whether the addresses are equal by value.


g_mime_internet_address_compare ()

int
g_mime_internet_address_compare (GMimeInternetAddress *ia,
                                 GMimeInternetAddress *other);

Compares nullable names case-sensitively using UTF-8 byte order. Mailboxes with equal names compare complete addr-specs with case-sensitive local parts and IDN-encoded, ASCII-lowercase domains. Domainless addresses are compared as stored. Mailboxes sort before equal-name groups, and equal-name groups compare equal regardless of members. Ordering is not a test for value equality.

Parameters

Returns

a negative number, zero, or a positive number.


g_mime_internet_address_parse ()

GMimeInternetAddress *
g_mime_internet_address_parse (GMimeParserOptions *options,
                               const char *str,
                               gssize length,
                               GError **error);

Parses exactly one mailbox or group, allowing trailing comments and whitespace. Explicitly bounded input need not be NUL-terminated but cannot contain embedded NUL bytes.

Parameters

options

parser options.

[nullable]

str

address text

 

length

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

 

error

return location for a GError.

[nullable]

Returns

the address, or NULL on error.

[nullable][transfer full]

Types and Values

GMimeInternetAddress

typedef struct _GMimeInternetAddress GMimeInternetAddress;

An RFC 2822 Address object.

See Also

GMimeGroupAddress, GMimeMailboxAddress