## InternetAddressList InternetAddressList — A list of internet addresses |

## Synopsis

    struct              InternetAddressList;
    InternetAddressList * internet_address_list_new         (void);
    int                 internet_address_list_length        (InternetAddressList *list);
    void                internet_address_list_clear         (InternetAddressList *list);
    int                 internet_address_list_add           (InternetAddressList *list,
                                                             InternetAddress *ia);
    void                internet_address_list_insert        (InternetAddressList *list,
                                                             int index,
                                                             InternetAddress *ia);
    gboolean            internet_address_list_remove        (InternetAddressList *list,
                                                             InternetAddress *ia);
    gboolean            internet_address_list_remove_at     (InternetAddressList *list,
                                                             int index);
    gboolean            internet_address_list_contains      (InternetAddressList *list,
                                                             InternetAddress *ia);
    int                 internet_address_list_index_of      (InternetAddressList *list,
                                                             InternetAddress *ia);
    InternetAddress *   internet_address_list_get_address   (InternetAddressList *list,
                                                             int index);
    void                internet_address_list_set_address   (InternetAddressList *list,
                                                             int index,
                                                             InternetAddress *ia);
    void                internet_address_list_prepend       (InternetAddressList *list,
                                                             InternetAddressList *prepend);
    void                internet_address_list_append        (InternetAddressList *list,
                                                             InternetAddressList *append);
    char *              internet_address_list_to_string     (InternetAddressList *list,
                                                             gboolean encode);
    InternetAddressList * internet_address_list_parse_string
                                                            (const char *str);
    void                internet_address_list_writer        (InternetAddressList *list,
                                                             GString *str);

## Object Hierarchy

      GObject
       +----InternetAddressList

## Description

An InternetAddressList is a collection of InternetAddress objects.

## Details

### struct InternetAddressList

    struct InternetAddressList;

A collection of InternetAddress objects.

### internet_address_list_new ()

    InternetAddressList * internet_address_list_new         (void);

Creates a new InternetAddressList.

Returns : | a new InternetAddressList.

### internet_address_list_length ()

    int                 internet_address_list_length        (InternetAddressList *list);

Gets the length of the list.

`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.

`list` : | a InternetAddressList

### internet_address_list_add ()

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

Adds an InternetAddress to the InternetAddressList.

`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.

`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.

`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.

`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.

`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.

`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.

`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`.

`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`.

`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`.

`list` : | a InternetAddressList
`append` : | a InternetAddressList

### internet_address_list_to_string ()

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

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

`list` : | list of internet addresses
`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.

### internet_address_list_parse_string ()

    InternetAddressList * internet_address_list_parse_string
                                                            (const char *str);

Construct a list of internet addresses from the given string.

`str` : | a string containing internet addresses
Returns : | a InternetAddressList or `NULL` if the input string does not contain any addresses. [transfer full]

### internet_address_list_writer ()

    void                internet_address_list_writer        (InternetAddressList *list,
                                                             GString *str);

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

`list` : | list of internet addresses
`str` : | string to write to

## See Also

InternetAddress