## InternetAddressList InternetAddressList — A list of internet addresses |

## Functions

InternetAddressList * | internet_address_list_new ()
InternetAddressList * | internet_address_list_parse ()
int | internet_address_list_length ()
void | internet_address_list_clear ()
int | internet_address_list_add ()
void | internet_address_list_insert ()
gboolean | internet_address_list_remove ()
gboolean | internet_address_list_remove_at ()
gboolean | internet_address_list_contains ()
int | internet_address_list_index_of ()
InternetAddress * | internet_address_list_get_address ()
void | internet_address_list_set_address ()
void | internet_address_list_prepend ()
void | internet_address_list_append ()
char * | internet_address_list_to_string ()
void | internet_address_list_encode ()

## Types and Values

struct | InternetAddressList

## Object Hierarchy

        GObject
        ╰── InternetAddressList

## Description

An InternetAddressList is a collection of InternetAddress objects.

## Functions

### internet_address_list_new ()

    InternetAddressList *
    internet_address_list_new (void);

Creates a new InternetAddressList.

#### Returns

a new InternetAddressList.

### internet_address_list_parse ()

    InternetAddressList *
    internet_address_list_parse (GMimeParserOptions *options,
                                 const char *str);

Construct a list of internet addresses from the given string.

#### Parameters

options | a GMimeParserOptions or `NULL`. | [nullable]
str | a string containing internet addresses |

#### Returns

a InternetAddressList or `NULL` if the input string does not contain any addresses.

[nullable][transfer full]

### internet_address_list_length ()

    int
    internet_address_list_length (InternetAddressList *list);

Gets the length of the list.

#### Parameters

list | a InternetAddressList |

#### Returns

the number of InternetAddress objects in the list.

### internet_address_list_clear ()

    void
    internet_address_list_clear (InternetAddressList *list);

Clears the list of addresses.

#### Parameters

list | a InternetAddressList |

### internet_address_list_add ()

    int
    internet_address_list_add (InternetAddressList *list,
                               InternetAddress *ia);

Adds an InternetAddress to the InternetAddressList.

#### Parameters

list | a InternetAddressList |
ia | a InternetAddress |

#### Returns

the index of the added InternetAddress.

### internet_address_list_insert ()

    void
    internet_address_list_insert (InternetAddressList *list,
                                  int index,
                                  InternetAddress *ia);

Inserts an InternetAddress into the InternetAddressList at the specified index.

#### Parameters

list | a InternetAddressList |
index | index to insert at |
ia | a InternetAddress |

### internet_address_list_remove ()

    gboolean
    internet_address_list_remove (InternetAddressList *list,
                                  InternetAddress *ia);

Removes an InternetAddress from the InternetAddressList.

#### Parameters

list | a InternetAddressList |
ia | a InternetAddress |

#### Returns

`TRUE` if the specified InternetAddress was removed or `FALSE` otherwise.

### internet_address_list_remove_at ()

    gboolean
    internet_address_list_remove_at (InternetAddressList *list,
                                     int index);

Removes an InternetAddress from the InternetAddressList at the specified index.

#### Parameters

list | a InternetAddressList |
index | index to remove |

#### Returns

`TRUE` if an InternetAddress was removed or `FALSE` otherwise.

### internet_address_list_contains ()

    gboolean
    internet_address_list_contains (InternetAddressList *list,
                                    InternetAddress *ia);

Checks whether or not the specified InternetAddress is contained within the InternetAddressList.

#### Parameters

list | a InternetAddressList |
ia | a InternetAddress |

#### Returns

`TRUE` if the specified InternetAddress is contained within the specified InternetAddressList or `FALSE` otherwise.

### internet_address_list_index_of ()

    int
    internet_address_list_index_of (InternetAddressList *list,
                                    InternetAddress *ia);

Gets the index of the specified InternetAddress inside the InternetAddressList.

#### Parameters

list | a InternetAddressList |
ia | a InternetAddress |

#### Returns

the index of the requested InternetAddress within the InternetAddressList or `-1` if it is not contained within the InternetAddressList.

### internet_address_list_get_address ()

    InternetAddress *
    internet_address_list_get_address (InternetAddressList *list,
                                       int index);

Gets the InternetAddress at the specified index.

#### Parameters

list | a InternetAddressList |
index | index of InternetAddress to get |

#### Returns

the InternetAddress at the specified index or `NULL` if the index is out of range.

[transfer none]

### internet_address_list_set_address ()

    void
    internet_address_list_set_address (InternetAddressList *list,
                                       int index,
                                       InternetAddress *ia);

Sets the InternetAddress at the specified index to `ia` .

#### Parameters

list | a InternetAddressList |
index | index of InternetAddress to set |
ia | a InternetAddress |

### internet_address_list_prepend ()

    void
    internet_address_list_prepend (InternetAddressList *list,
                                   InternetAddressList *prepend);

Inserts all of the addresses in `prepend` to the beginning of `list` .

#### Parameters

list | a InternetAddressList |
prepend | a InternetAddressList |

### internet_address_list_append ()

    void
    internet_address_list_append (InternetAddressList *list,
                                  InternetAddressList *append);

Adds all of the addresses in `append` to `list` .

#### Parameters

list | a InternetAddressList |
append | a InternetAddressList |

### internet_address_list_to_string ()

    char *
    internet_address_list_to_string (InternetAddressList *list,
                                     GMimeFormatOptions *options,
                                     gboolean encode);

Allocates a string buffer containing the rfc822 formatted addresses in `list` .

#### Parameters

list | list of internet addresses |
options | a GMimeFormatOptions or `NULL`. | [nullable]
encode | `TRUE` if the address should be rfc2047 encoded |

#### Returns

a string containing the list of addresses in rfc822 format or `NULL` if no addresses are contained in the list.

[nullable]

### internet_address_list_encode ()

    void
    internet_address_list_encode (InternetAddressList *list,
                                  GMimeFormatOptions *options,
                                  GString *str);

Writes the rfc2047-encoded rfc822 formatted addresses in `list` to `str` , folding appropriately.

#### Parameters

list | list of internet addresses |
options | a GMimeFormatOptions or `NULL`. | [nullable]
str | string to write to |

## Types and Values

### struct InternetAddressList

    struct InternetAddressList;

A collection of InternetAddress objects.

#### Members

## See Also

InternetAddress